From cf164be0c8f43c3d1387c9c9f7ae73c2cf1b3a02 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 16 Apr 2022 14:51:58 +0900 Subject: merge rendering files + remove themes --- src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/java/io/polyfrost/oneconfig/utils/MathUtils.java (limited to 'src/main/java/io/polyfrost/oneconfig/utils') 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; + } + } +} -- cgit