The Color class represents a specific color to the system.
public final class java.awt.Color extends java.lang.Object implements java.io.Serializable { // Constants public static final Color black; public static final Color blue; public static final Color cyan; public static final Color darkGray; public static final Color gray; public static final Color green; public static final Color lightGray; public static final Color magenta; public static final Color orange; public static final Color pink; public static final Color red; public static final Color white; public static final Color yellow; // Constructors public Color (int rgb); public Color (int red, int green, int blue); public Color (float red, float green, float blue); // Class Methods public static Color decode (String name); public static Color getColor (String name); public static Color getColor (String name, Color defaultColor); public static Color getColor (String name, int defaultColor); public static Color getHSBColor (float hue, float saturation, float brightness); public static int HSBtoRGB (float hue, float saturation, float brightness); public static float[] RGBtoHSB (int red, int green, int blue, float hsbvalues[]); // Instance Methods public Color brighter(); public Color darker(); public boolean equals (Object object); public int getBlue(); public int getGreen(); public int getRed(); public int getRGB(); public int hashCode(); public String toString(); }
The color black.
The color blue.
The color cyan.
The color dark gray.
The color gray.
The color green.
The color light gray.
The color magenta.
The color orange.
The color pink.
The color red.
The color white.
The color yellow.
Composite color value
Constructs a Color object with the given rgb value.
Red component of color in the range[0, 255]
Green component of color in the range[0, 255]
Blue component of color in the range[0, 255]
Constructs a Color object with the given red, green, and blue values.
Red component of color in the range[0.0, 1.0]
Green component of color in the range[0.0, 1.0]
Blue component of color in the range[0.0, 1.0]
Constructs a Color object with the given red, green, and blue values.
A String representing a color as a 24-bit integer.
The color requested.
If nm cannot be converted to a number.
Gets color specified by the given string.
The name of a system property indicating which color to fetch.
Color instance of name requested, or null if the name is invalid.
Gets color specified by the system property name.
The name of a system property indicating which color to fetch.
Color to return if name is not found in properties, or invalid.
Color instance of name requested, or defaultColor if the name is invalid.
Gets color specified by the system property name.
The name of a system property indicating which color to fetch.
Color to return if name is not found in properties, or invalid.
Color instance of name requested, or defaultColor if the name is invalid.
Gets color specified by the system property name. The default color is specified as a 32-bit RGB value.
Hue component of Color to create, in the range[0.0, 1.0].
Saturation component of Color to create, in the range[0.0, 1.0].
Brightness component of Color to create, in the range[0.0, 1.0].
Color instance for values provided.
Create an instance of Color by using hue, saturation, and brightness instead of red, green, and blue values.
Hue component of Color to convert, in the range[0.0, 1.0].
Saturation component of Color to convert, in the range[0.0, 1.0].
Brightness component of Color to convert, in the range[0.0, 1.0].
Color value for hue, saturation, and brightness provided.
Converts a specific hue, saturation, and brightness to a Color and returns the red, green, and blue values in a composite integer value.
Red component of Color to convert, in the range[0, 255].
Green component of Color to convert, in the range[0, 255].
Blue component of Color to convert, in the range[0, 255].
Three element array in which to put the result. This array is used as the method's return object. If null, a new array is allocated.
Hue, saturation, and brightness values for Color provided, in elements 0, 1, and 2 (respectively) of the returned array.
Allows you to convert specific red, green, blue value to the hue, saturation, and brightness equivalent.
Brighter version of current color.
Creates new Color that is somewhat brighter than current.
Darker version of current color.
Creates new Color that is somewhat darker than current.
The object to compare.
true if object represents the same color, false otherwise.
Object.equals(Object)
Compares two different Color instances for equivalence.
Blue component of current color.
Green component of current color.
Red component of current color.
Current color as a composite value.
Gets integer value of current color.
A hashcode to use when storing Color in a Hashtable.
Object.hashCode()
Generates a hashcode for the Color.
A string representation of the Color object.
Object.toString()
Object, Properties, Serializable, String