All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.Color
java.lang.Object
|
+----java.awt.Color
- public class Color
- extends Object
- implements Serializable
A class to encapsulate RGB Colors.
-
black
- The color black.
-
blue
- The color blue.
-
cyan
- The color cyan.
-
darkGray
- The color dark gray.
-
gray
- The color gray.
-
green
- The color green.
-
lightGray
- The color light gray.
-
magenta
- The color magneta.
-
orange
- The color orange.
-
pink
- The color pink.
-
red
- The color red.
-
white
- The color white.
-
yellow
- The color yellow.
-
Color(float, float, float)
- Creates a color with the specified red, green, and blue values in the
range (0.0 - 1.0).
-
Color(int)
- Creates a color with the specified combined RGB value consisting of
the red component in bits 16-23, the green component in bits 8-15,
and the blue component in bits 0-7.
-
Color(int, int, int)
- Creates a color with the specified red, green, and blue values in
the range (0 - 255).
-
brighter()
- Returns a brighter version of this color.
-
darker()
- Returns a darker version of this color.
-
decode(String)
- Gets the specified Color.
-
equals(Object)
- Compares this object against the specified object.
-
getBlue()
- Gets the blue component.
-
getColor(String)
- Gets the specified Color property.
-
getColor(String, Color)
- Gets the specified Color property of the specified Color.
-
getColor(String, int)
- Gets the specified Color property of the color value.
-
getGreen()
- Gets the green component.
-
getHSBColor(float, float, float)
- A static Color factory for generating a Color object from HSB
values.
-
getRed()
- Gets the red component.
-
getRGB()
- Gets the RGB value representing the color in the default RGB ColorModel.
-
hashCode()
- Computes the hash code.
-
HSBtoRGB(float, float, float)
- Returns the RGB value defined by the default RGB ColorModel, of
the color corresponding to the given HSB color components.
-
RGBtoHSB(int, int, int, float[])
- Returns the HSB values corresponding to the color defined by the
red, green, and blue components.
-
toString()
- Returns the String representation of this Color's values.
white
Properties Public Constant
white=Color
- The color white.
lightGray
Properties Public Constant
lightGray=Color
- The color light gray.
gray
Properties Public Constant
gray=Color
- The color gray.
darkGray
Properties Public Constant
darkGray=Color
- The color dark gray.
black
Properties Public Constant
black=Color
- The color black.
red
Properties Public Constant
red=Color
- The color red.
pink
Properties Public Constant
pink=Color
- The color pink.
orange
Properties Public Constant
orange=Color
- The color orange.
yellow
Properties Public Constant
yellow=Color
- The color yellow.
green
Properties Public Constant
green=Color
- The color green.
magenta
Properties Public Constant
magenta=Color
- The color magneta.
cyan
Properties Public Constant
cyan=Color
- The color cyan.
blue
Properties Public Constant
blue=Color
- The color blue.
Color
method Color(r=int, -
g=int, -
b=int) public
- Creates a color with the specified red, green, and blue values in
the range (0 - 255). The actual color used in rendering will depend
on finding the best match given the color space available for a
given output device.
- Parameters:
- r - the red component
- g - the green component
- b - the blue component
- See Also:
- getRed, getGreen, getBlue, getRGB
Color
method Color(rgb=int) public
- Creates a color with the specified combined RGB value consisting of
the red component in bits 16-23, the green component in bits 8-15,
and the blue component in bits 0-7. The actual color used in
rendering will depend on finding the best match given the color space
available for a given output device.
- Parameters:
- rgb - the combined RGB components
- See Also:
- getRGBdefault, getRed, getGreen, getBlue, getRGB
Color
method Color(r=float, -
g=float, -
b=float) public
- Creates a color with the specified red, green, and blue values in the
range (0.0 - 1.0). The actual color
used in rendering will depend on finding the best match given the
color space available for a given output device.
- Parameters:
- r - the red component
- g - the red component
- b - the red component
- See Also:
- getRed, getGreen, getBlue, getRGB
getRed
method getRed() returns int public
- Gets the red component.
- See Also:
- getRGB
getGreen
method getGreen() returns int public
- Gets the green component.
- See Also:
- getRGB
getBlue
method getBlue() returns int public
- Gets the blue component.
- See Also:
- getRGB
getRGB
method getRGB() returns int public
- Gets the RGB value representing the color in the default RGB ColorModel.
(Bits 24-31 are 0xff, 16-23 are red, 8-15 are green, 0-7 are blue).
- See Also:
- getRGBdefault, getRed, getGreen, getBlue
brighter
method brighter() returns Color public
- Returns a brighter version of this color.
darker
method darker() returns Color public
- Returns a darker version of this color.
hashCode
method hashCode() returns int public
- Computes the hash code.
- Overrides:
- hashCode in class Object
equals
method equals(obj=Object) returns boolean public
- Compares this object against the specified object.
- Parameters:
- obj - the object to compare with.
- Returns:
- true if the objects are the same; false otherwise.
- Overrides:
- equals in class Object
toString
method toString() returns String public
- Returns the String representation of this Color's values.
- Overrides:
- toString in class Object
decode
method decode(nm=String) returns Color public static Signals NumberFormatException
- Gets the specified Color.
- Parameters:
- nm - representation of the color as a 24-bit integer
- Returns:
- the new color
getColor
method getColor(nm=String) returns Color public static
- Gets the specified Color property.
- Parameters:
- nm - the name of the color property
getColor
method getColor(nm=String, -
v=Color) returns Color public static
- Gets the specified Color property of the specified Color.
- Parameters:
- nm - the name of the color property
- v - the specified color
- Returns:
- the new color.
getColor
method getColor(nm=String, -
v=int) returns Color public static
- Gets the specified Color property of the color value.
- Parameters:
- nm - the name of the color property
- v - the color value
- Returns:
- the new color.
HSBtoRGB
method HSBtoRGB(hue=float, -
saturation=float, -
brightness=float) returns int public static
- Returns the RGB value defined by the default RGB ColorModel, of
the color corresponding to the given HSB color components.
- Parameters:
- hue - the hue component of the color
- saturation - the saturation of the color
- brightness - the brightness of the color
- See Also:
- getRGBdefault, getRGB
RGBtoHSB
method RGBtoHSB(r=int, -
g=int, -
b=int, -
hsbvals=float[]) returns float[] public static
- Returns the HSB values corresponding to the color defined by the
red, green, and blue components.
- Parameters:
- r - the red component of the color
- g - the green component of the color
- b - the blue component of the color
- hsbvals - the array to be used to return the 3 HSB values, or null
- Returns:
- the array used to store the results [hue, saturation, brightness]
- See Also:
- getRGBdefault, getRGB
getHSBColor
method getHSBColor(h=float, -
s=float, -
b=float) returns Color public static
- A static Color factory for generating a Color object from HSB
values.
- Parameters:
- h - the hue component
- s - the saturation of the color
- b - the brightness of the color
- Returns:
- the Color object for the corresponding RGB color
All Packages Class Hierarchy This Package Previous Next Index