From 930810863aa84fb19c9ca0f17b9ab94e8820611e Mon Sep 17 00:00:00 2001 From: Aram Date: Tue, 3 Dec 2024 23:08:40 +0100 Subject: [PATCH] Final Typos --- .../bluelib/markdown/MarkdownFeature.java | 2 +- .../utils/conversion/ColorConverterUtils.java | 67 ------------------- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 common/src/main/java/software/bluelib/utils/conversion/ColorConverterUtils.java diff --git a/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java b/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java index a33c864e..073574c5 100644 --- a/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java +++ b/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java @@ -23,7 +23,7 @@ * * * @author MeAlam - * @version 1.3.0 + * @version 1.4.0 * @since 1.1.0 */ public abstract class MarkdownFeature { diff --git a/common/src/main/java/software/bluelib/utils/conversion/ColorConverterUtils.java b/common/src/main/java/software/bluelib/utils/conversion/ColorConverterUtils.java deleted file mode 100644 index f2bf697d..00000000 --- a/common/src/main/java/software/bluelib/utils/conversion/ColorConverterUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -package software.bluelib.utils.conversion; - -public class ColorConverterUtils { - - public static int rgbToHex(int pRed, int pGreen, int pBlue) { - return (pRed << 16) | (pGreen << 8) | pBlue; - } - - public static int argbToHex(int pAlpha, int pRed, int pGreen, int pBlue) { - return (pAlpha << 24) | (pRed << 16) | (pGreen << 8) | pBlue; - } - - public static int hexStringToHex(String pHexString) { - return Integer.parseUnsignedInt(pHexString.replace("#", ""), 16); - } - - public static int hslToHex(float pHue, float pSaturation, float pLightness) { - float c = (1 - Math.abs(2 * pLightness - 1)) * pSaturation; - float x = c * (1 - Math.abs((pHue / 60) % 2 - 1)); - float m = pLightness - c / 2; - - return calculateRGB(pHue, c, x, m); - } - - private static int calculateRGB(float pHue, float pC, float pX, float pM) { - float r, g, b; - if (pHue < 60) { - r = pC; - g = pX; - b = 0; - } else if (pHue < 120) { - r = pX; - g = pC; - b = 0; - } else if (pHue < 180) { - r = 0; - g = pC; - b = pX; - } else if (pHue < 240) { - r = 0; - g = pX; - b = pC; - } else if (pHue < 300) { - r = pX; - g = 0; - b = pC; - } else { - r = pC; - g = 0; - b = pX; - } - - int red = Math.round((r + pM)) * 255; - int green = Math.round((g + pM)) * 255; - int blue = Math.round((b + pM)) * 255; - - return rgbToHex(red, green, blue); - } - - public static int hsvToHex(float pHue, float pSaturation, float pValue) { - float c = pValue * pSaturation; - float x = c * (1 - Math.abs((pHue / 60) % 2 - 1)); - float m = pValue - c; - - return calculateRGB(pHue, c, x, m); - } -}