Class ColorTool
java.lang.Object
com.jackmeng.halcyoninae.halcyon.utils.ColorTool
A Class to manipulate Color utility
- Since:
- 2.0
- Author:
- Jack Meng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorbrightenColor(Color c, int percent) static int[]Returns an integer array representing the standard RED GREEN BLUE colors.static ColorGet a color with 0 RED GREEN BLUE ALPHAstatic ColorGiven a hex, it will return aColorObject representing the color.static StringConvert a color object to a string hex representation.static ColorrndColor()Returns a random color
-
Constructor Details
-
ColorTool
private ColorTool()
-
-
Method Details
-
hexToRGBA
Given a hex, it will return aColorObject representing the color.- Parameters:
hex- The hex to convert- Returns:
- Color The color object
-
rgbTohex
Convert a color object to a string hex representation.- Parameters:
color- The color to convert- Returns:
- String The hex representation of the color
-
brightenColor
- Parameters:
c-percent-- Returns:
- Color
-
colorBreakDown
Returns an integer array representing the standard RED GREEN BLUE colors. Where arr[0]:RED arr[1]:GREEN arr[2]:BLUE. Alpha is not represented- Parameters:
c- A Color object (java.awt.Color)- Returns:
- An integer array of length 3
-
getNullColor
Get a color with 0 RED GREEN BLUE ALPHA- Returns:
- A Color object (java.awt.Color)
-
rndColor
Returns a random color- Returns:
- A color object (int8)
-