diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-04-16 14:51:58 +0900 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-04-16 14:51:58 +0900 |
commit | cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02 (patch) | |
tree | c3f2cbfe39919941b9bb04f6de2e3cec103509fd /src/main/java/io/polyfrost/oneconfig/utils | |
parent | f10f1165a7c2ea88ce7bb265d51b52eeaa64d8f8 (diff) | |
download | OneConfig-cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02.tar.gz OneConfig-cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02.tar.bz2 OneConfig-cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02.zip |
merge rendering files + remove themes
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/utils')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java new file mode 100644 index 0000000..e2e5184 --- /dev/null +++ b/src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java @@ -0,0 +1,15 @@ +package io.polyfrost.oneconfig.utils; + +public class MathUtils { + public static float clamp(float number) { + return number < (float) 0.0 ? (float) 0.0 : Math.min(number, (float) 1.0); + } + + public static float easeOut(float current, float goal) { + if (Math.floor(Math.abs(goal - current) / (float) 0.01) > 0) { + return current + (goal - current) / (float) 20.0; + } else { + return goal; + } + } +} |