diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java b/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java index f675778..38a48cc 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/SpecialColour.java @@ -5,24 +5,12 @@ import java.awt.*; public class SpecialColour { public static String special(int chromaSpeed, int alpha, int rgb) { - return special( - chromaSpeed, - alpha, - (rgb & 0xFF0000) >> 16, - (rgb & 0x00FF00) >> 8, - (rgb & 0x0000FF) - ); + return special(chromaSpeed, alpha, (rgb & 0xFF0000) >> 16, (rgb & 0x00FF00) >> 8, (rgb & 0x0000FF)); } private static final int RADIX = 10; - public static String special( - int chromaSpeed, - int alpha, - int r, - int g, - int b - ) { + public static String special(int chromaSpeed, int alpha, int r, int g, int b) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toString(chromaSpeed, RADIX)).append(":"); sb.append(Integer.toString(alpha, RADIX)).append(":"); @@ -51,9 +39,7 @@ public class SpecialColour { int a = d[3]; int chr = d[4]; - return ( - (a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF) - ); + return ((a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF)); } public static int getSpeed(String special) { @@ -61,12 +47,7 @@ public class SpecialColour { } public static float getSecondsForSpeed(int speed) { - return ( - (255 - speed) / - 254f * - (MAX_CHROMA_SECS - MIN_CHROMA_SECS) + - MIN_CHROMA_SECS - ); + return ((255 - speed) / 254f * (MAX_CHROMA_SECS - MIN_CHROMA_SECS) + MIN_CHROMA_SECS); } private static final int MIN_CHROMA_SECS = 1; @@ -88,16 +69,12 @@ public class SpecialColour { if (chr > 0) { float seconds = getSecondsForSpeed(chr); - hsv[0] += - (System.currentTimeMillis() - startTime) / 1000f / seconds; + hsv[0] += (System.currentTimeMillis() - startTime) / 1000f / seconds; hsv[0] %= 1; if (hsv[0] < 0) hsv[0] += 1; } - return ( - (a & 0xFF) << 24 | - (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF) - ); + return ((a & 0xFF) << 24 | (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF)); } public static int rotateHue(int argb, int degrees) { @@ -111,9 +88,6 @@ public class SpecialColour { hsv[0] += degrees / 360f; hsv[0] %= 1; - return ( - (a & 0xFF) << 24 | - (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF) - ); + return ((a & 0xFF) << 24 | (Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]) & 0x00FFFFFF)); } } |