Class ColorUtils
java.lang.Object
me.emafire003.dev.coloredglowlib.util.ColorUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckDefault(String color) static booleancheckSameColor(String color, String color1) static booleanisCustomAnimation(String color) Checks if a given color is a custom animation added by a datapackstatic booleanisHexColor(String str) Checks if a given String represents a Color in Hexadecimal format.static booleanisValidColor(String color) Checks is a given string is actually a valid colorstatic booleanisValidColorOrCustom(String color) Checks is a given string is actually a valid colorstatic inttoColorValue(int r, int g, int b) Converts RGB decimal numbers into a single Color valuestatic inttoColorValue(String hex) Converts a given string to an integer Color value The string is checked with isHexColor to confirm it's indeed a color in hex string format.static StringtoHex(int colorValue) Converts a given integer Color value to anstatic StringtoHex(int r, int g, int b) static int[]
-
Field Details
-
WHITE
- See Also:
-
RED
- See Also:
-
GREEN
- See Also:
-
BLUE
- See Also:
-
BLACK
- See Also:
-
-
Constructor Details
-
ColorUtils
public ColorUtils()
-
-
Method Details
-
isHexColor
Checks if a given String represents a Color in Hexadecimal format. The string can start with or without "#"- Parameters:
str- The supposed string color to check- Returns:
- Returns weather teh givin string is a color or not
-
toColorValue
public static int toColorValue(int r, int g, int b) Converts RGB decimal numbers into a single Color value- Parameters:
r- The red RGB value (0-255)g- The green RGB value (0-255)b- The blue RGB value (0-255)
-
toColorValue
Converts a given string to an integer Color value The string is checked with isHexColor to confirm it's indeed a color in hex string format. The string can start with or without "#"- Parameters:
hex- The string representing the color in hexadecimal format- Returns:
- Returns the color value corresponding to the string, or black if the string was not a color
-
toHex
Converts a given integer Color value to an -
toHex
-
checkDefault
-
checkSameColor
-
toRGB
-
isValidColor
Checks is a given string is actually a valid colorIt's here instead of in the API because it is sometimes needed before the server loads
-
isValidColorOrCustom
Checks is a given string is actually a valid colorIt's here instead of in the API because it is sometimes needed before the server loads
-
isCustomAnimation
Checks if a given color is a custom animation added by a datapack
-