Class XColor

java.lang.Object
   |
   +----java.awt.Color
           |
           +----XColor

public class XColor
extends Color
A Color subclass that provides all the RGB color names from The X Window System rgb.txt color database.

The X11 file rgb.txt contains 752 color names and their RGB values. Many of these, however, are shades of gray (also spelt grey), and most of the longer names appear as both one word and multi-word ("deep sky blue" and "deepskyblue"). There are perhaps 200-300 distinct colors. If you have an 8-bit (or less:-( ) display, you will not be able to see them all as distinct. Either form, as well as upper, lower or mixed case can be used when constructing XColors.

See Also:
XColorTest

Variable Index

 o data
The entire data structure: a list of color names, with the R, G, and B values for each name.
 o name
The default name (in case you print me after a failed construction)

Constructor Index

 o XColor(int)
Construct an XColor given a color value
 o XColor(String)
Construct an XColor given a color value.

Method Index

 o getColorList()
Get the list of all available colors, as a pre-sorted array
 o toString()
Provide a printable form of this color
 o XColorByName(String)
 o XColorByValue(int)

Variables

 o name
 protected String name
The default name (in case you print me after a failed construction)

 o data
 protected static Setting data[]
The entire data structure: a list of color names, with the R, G, and B values for each name.

Constructors

 o XColor
 public XColor(String nm)
Construct an XColor given a color value. Constructs the Color with 0,0,0 (==black), then overrides "value" in Color to be the RGB of the chosen color.

Throws: IllegalArgumentException
if the color can't be found.
 o XColor
 public XColor(int val)
Construct an XColor given a color value

Methods

 o XColorByName
 public static int XColorByName(String nm)
 o XColorByValue
 public static String XColorByValue(int val)
 o getColorList
 public String[] getColorList()
Get the list of all available colors, as a pre-sorted array

 o toString
 public String toString()
Provide a printable form of this color

Overrides:
toString in class Color