public class ColorUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int[] |
colorArgbs |
private static java.lang.String[] |
colorNames |
private static java.util.Map<java.lang.String,java.lang.Integer> |
mapJavaScriptColors |
Constructor and Description |
---|
ColorUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
calcGreyscaleRgbFromRgb(int rgb)
Return a greyscale rgb value 0-FF using NTSC color luminance algorithm
|
static P3 |
colorPointFromInt(int color,
P3 pt) |
static P3 |
colorPointFromInt2(int color) |
static P3 |
colorPointFromString(java.lang.String colorName,
P3 pt) |
static int |
colorPtToInt(Tuple3f pt) |
static int |
colorTriadToInt(float x,
float y,
float z) |
static int |
getArgbFromString(java.lang.String strColor)
accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or
[red,green,blue] or a valid JavaScript color
|
static short |
getBgContrast(int argb) |
static int |
rgb(int red,
int grn,
int blu) |
private static final java.lang.String[] colorNames
private static final int[] colorArgbs
private static final java.util.Map<java.lang.String,java.lang.Integer> mapJavaScriptColors
public static int getArgbFromString(java.lang.String strColor)
strColor
- public static int colorTriadToInt(float x, float y, float z)
public static int rgb(int red, int grn, int blu)
public static final P3 colorPointFromInt2(int color)
public static int colorPtToInt(Tuple3f pt)
public static int calcGreyscaleRgbFromRgb(int rgb)
the alpha component is set to 0xFF. If you want a value in the range 0-255 then & the result with 0xFF;
rgb
- the rgb valuepublic static short getBgContrast(int argb)