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 javax.vecmath.Point3f |
colorPointFromInt(int color,
javax.vecmath.Point3f pt) |
static javax.vecmath.Point3f |
colorPointFromInt2(int color) |
static javax.vecmath.Point3f |
colorPointFromString(java.lang.String colorName,
javax.vecmath.Point3f pt) |
static int |
colorPtToInt(javax.vecmath.Point3f 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 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 javax.vecmath.Point3f colorPointFromString(java.lang.String colorName, javax.vecmath.Point3f pt)
public static final javax.vecmath.Point3f colorPointFromInt2(int color)
public static int colorPtToInt(javax.vecmath.Point3f pt)
public static final javax.vecmath.Point3f colorPointFromInt(int color, javax.vecmath.Point3f 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 value