Class Color

java.lang.Object
  extended by Color

public class Color
extends java.lang.Object

Represents a color with red, green, and blue components.


Field Summary
static Color BLACK
           
static Color WHITE
           
 
Constructor Summary
Color(double r, double g, double b)
          Constructs a color with the given color components.
Color(float r, float g, float b)
          Constructs a color with the given color components.
 
Method Summary
 Color add(Color other)
          Constructs a color whose color components are the sum of this color's components and the parameter color's components.
 float getBlue()
          Returns the blue color component.
 float getGreen()
          Returns the green color component.
 float getRed()
          Returns the red color component.
 int getRGB()
          Returns the argb encoding of this color.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final Color BLACK

WHITE

public static final Color WHITE
Constructor Detail

Color

public Color(double r,
             double g,
             double b)
Constructs a color with the given color components.


Color

public Color(float r,
             float g,
             float b)
Constructs a color with the given color components.

Method Detail

toString

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

getRed

public float getRed()
Returns the red color component.


getGreen

public float getGreen()
Returns the green color component.


getBlue

public float getBlue()
Returns the blue color component.


add

public Color add(Color other)
Constructs a color whose color components are the sum of this color's components and the parameter color's components.


getRGB

public int getRGB()
Returns the argb encoding of this color.