|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Color ch.aplu.util.X11Color
public class X11Color
This class provides the mapping of X11 colors names (in string notation)
to RGB colors represented the java.awt.Color class.
See
http://en.wikipedia.org/wiki/X11_color_names
for the names and a view of the colors.
Field Summary | |
---|---|
static java.awt.Color[] |
RAINBOW_COLORS
|
Fields inherited from class java.awt.Color |
---|
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW |
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
X11Color(java.lang.String colorStr)
Creates a color with given X11 color name. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.awt.Color |
---|
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 |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.awt.Color[] RAINBOW_COLORS
Constructor Detail |
---|
public X11Color(java.lang.String colorStr)
colorStr
- the X11 color name (case insensitive)Method Detail |
---|
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 name
public 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).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |