public class X11Color
extends java.awt.Color
Modifier and Type | Field and Description |
---|---|
static java.awt.Color[] |
RAINBOW_COLORS |
Constructor and Description |
---|
X11Color(java.lang.String colorStr)
Creates a color with given X11 color name.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
getColorNames()
Returns the implemented X11 color names.
|
static java.awt.Color |
getRandomColor()
Returns a random color from the X11 color set.
|
static java.lang.String |
getRandomColorStr()
Returns a random X11 color from the X11 color set.
|
static java.awt.Color |
toColor(java.lang.String colorStr)
Returns the color reference attributed to the given X11 color name.
|
static java.lang.String |
toColorStr(java.awt.Color color)
Returns the X11 color name attributed to the given color.
|
static java.awt.Color |
wavelengthToColor(int wavelength)
Returns the color corresponding to the spectral wavelength.
|
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
public X11Color(java.lang.String colorStr)
colorStr
- the X11 color name (case insensitive)public static java.lang.String[] getColorNames()
public static java.awt.Color toColor(java.lang.String colorStr)
colorStr
- the X11 color name (case insensitive)public static java.lang.String toColorStr(java.awt.Color color)
color
- the color to search for the X11 namepublic static java.awt.Color getRandomColor()
public static java.lang.String getRandomColorStr()
public static java.awt.Color wavelengthToColor(int wavelength)
wavelength
- the wavelength in nm (between 380nm and 780nm).