org.metasyntactic.graphics.primitives
Class Color

java.lang.Object
  |
  +--org.metasyntactic.graphics.primitives.Color

public class Color
extends java.lang.Object


Field Summary
static Color BLACK
           
static Color BLUE
           
static Color WHITE
           
 
Constructor Summary
Color(double red, double green, double blue)
           
Color(double red, double green, double blue, double alpha)
          Creates a new instance of Color
 
Method Summary
 Color add(Color c)
           
static Color add(Color[] colors)
           
 boolean equals(java.lang.Object o)
           
static Color fromAWT(java.awt.Color c)
           
static Color fromXML(org.w3c.dom.Element element)
           
 double getAlpha()
          Getter for property alpha.
 double getBlue()
          Getter for property blue.
 double getGreen()
          Getter for property green.
 double getRed()
          Getter for property red.
 Color multiply(double d)
           
static Color randomColor()
           
static Color randomGray()
           
 void setAlpha(double alpha)
          Setter for property alpha.
 void setBlue(double blue)
          Setter for property blue.
 void setGreen(double green)
          Setter for property green.
 void setRed(double red)
          Setter for property red.
 java.awt.Color toAWT()
           
 java.lang.String toXML()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

public static Color BLACK

BLUE

public static Color BLUE

WHITE

public static Color WHITE
Constructor Detail

Color

public Color(double red,
             double green,
             double blue,
             double alpha)
Creates a new instance of Color


Color

public Color(double red,
             double green,
             double blue)
Method Detail

fromAWT

public static Color fromAWT(java.awt.Color c)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

add

public static Color add(Color[] colors)

add

public Color add(Color c)

multiply

public Color multiply(double d)

getRed

public double getRed()
Getter for property red.

Returns:
Value of property red.

setRed

public void setRed(double red)
Setter for property red.

Parameters:
red - New value of property red.

getBlue

public double getBlue()
Getter for property blue.

Returns:
Value of property blue.

setBlue

public void setBlue(double blue)
Setter for property blue.

Parameters:
blue - New value of property blue.

getGreen

public double getGreen()
Getter for property green.

Returns:
Value of property green.

setGreen

public void setGreen(double green)
Setter for property green.

Parameters:
green - New value of property green.

getAlpha

public double getAlpha()
Getter for property alpha.

Returns:
Value of property alpha.

setAlpha

public void setAlpha(double alpha)
Setter for property alpha.

Parameters:
alpha - New value of property alpha.

toAWT

public java.awt.Color toAWT()

randomColor

public static Color randomColor()

randomGray

public static Color randomGray()

fromXML

public static Color fromXML(org.w3c.dom.Element element)

toXML

public java.lang.String toXML()