Class CU
java.lang.Object
javajs.util.CU
ColorUtility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final P3colorPtFromInt(int color, P3 pt) static final P3colorPtFromString(String colorName) static intcolorPtToFFRGB(T3 pt) static intcolorTriadToFFRGB(float x, float y, float z) static intgetArgbFromString(String strColor) accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or [red,green,blue] or a valid JavaScript colorstatic P3Convert HSL (hue/saturation/luninance) values to RGBstatic intrgb(int red, int grn, int blu) static P3Convert RGB values to HSL (hue/saturation/lightness)static Stringstatic inttoFFGGGfromRGB(int rgb) Return a greyscale rgb value 0-FF using NTSC color lightness algorithmstatic voidtoRGB3f(int c, float[] f) static String
-
Constructor Details
-
CU
public CU()
-
-
Method Details
-
toRGBHexString
-
toCSSString
-
getArgbFromString
accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or [red,green,blue] or a valid JavaScript color- Parameters:
strColor-- Returns:
- 0 if invalid or integer color
-
colorTriadToFFRGB
public static int colorTriadToFFRGB(float x, float y, float z) -
rgb
public static int rgb(int red, int grn, int blu) -
colorPtFromString
-
colorPtFromInt
-
colorPtToFFRGB
-
toRGB3f
public static void toRGB3f(int c, float[] f) -
toFFGGGfromRGB
public static int toFFGGGfromRGB(int rgb) Return a greyscale rgb value 0-FF using NTSC color lightness algorithmthe alpha component is set to 0xFF. If you want a value in the range 0-255 then invalid input: '&' the result with 0xFF;
- Parameters:
rgb- the rgb value- Returns:
- a grayscale value in the range 0 - 255 decimal
-
rgbToHSL
-
hslToRGB
-