nextapp.echo
Class Color

java.lang.Object
  extended by nextapp.echo.Color
All Implemented Interfaces:
java.io.Serializable

public class Color
extends java.lang.Object
implements java.io.Serializable

A representation of an RGB color.

See Also:
Serialized Form

Field Summary
static Color BLACK
          The color black.
static Color BLUE
          The color blue.
static Color CYAN
          The color cyan.
static Color DARKGRAY
          The color dark gray.
static Color GREEN
          The color green.
static Color LIGHTGRAY
          The color light gray.
static Color MAGENTA
          The color magenta.
static Color ORANGE
          The color orange.
static Color PINK
          The color pink.
static Color RED
          The color red.
static Color WHITE
          The color white.
static Color YELLOW
          The color yellow.
 
Constructor Summary
Color(int rgb)
          Creates a new color from an integer value.
Color(int r, int g, int b)
          Creates a new color with specified red, green, and blue values.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines whether another object is equal to this Color.
 int getBlue()
          Returns the blue component value of this color.
 int getGreen()
          Returns the green component value of this color.
 int getRed()
          Returns the red component value of this color.
 int getRgb()
          Returns the color as an RGB value.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final Color BLACK
The color black.


BLUE

public static final Color BLUE
The color blue.


GREEN

public static final Color GREEN
The color green.


CYAN

public static final Color CYAN
The color cyan.


RED

public static final Color RED
The color red.


MAGENTA

public static final Color MAGENTA
The color magenta.


YELLOW

public static final Color YELLOW
The color yellow.


WHITE

public static final Color WHITE
The color white.


DARKGRAY

public static final Color DARKGRAY
The color dark gray.


LIGHTGRAY

public static final Color LIGHTGRAY
The color light gray.


ORANGE

public static final Color ORANGE
The color orange.


PINK

public static final Color PINK
The color pink.

Constructor Detail

Color

public Color(int rgb)
Creates a new color from an integer value. The value should be of the for 0xRRGGBB.

Parameters:
rgb - An integer representation for a color.

Color

public Color(int r,
             int g,
             int b)
Creates a new color with specified red, green, and blue values. Each value may range from 0 to 255.

Parameters:
r - The red component value.
g - The green component value.
b - The blue component value.
Method Detail

equals

public boolean equals(java.lang.Object o)
Determines whether another object is equal to this Color.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object with which to compare this color.
Returns:
True if the other object is equal to this one.

getBlue

public int getBlue()
Returns the blue component value of this color.

Returns:
The blue component value of this color, from 0 to 255.

getGreen

public int getGreen()
Returns the green component value of this color.

Returns:
The green component value of this color, from 0 to 255.

getRed

public int getRed()
Returns the red component value of this color.

Returns:
The red component value of this color, from 0 to 255.

getRgb

public int getRgb()
Returns the color as an RGB value.

Returns:
The color as an RGB value.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code value for the object. This value is equivalent to that returned in the getRgb() method.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()