edu.byu.phun2d
Class Color

java.lang.Object
  extended by edu.byu.phun2d.Color

public class Color
extends java.lang.Object

This is an object that represents a color. Colors are specified using red, green and blue components. A value of 0 means that none of that component is to be added. A value of 1.0 means that all of that component should be added.

All of the visible colors can be represented using these three components. For example:

Colors can be create by specifying each of the red, green and blue components or there are constants for many common colors such as: Color.BLUE or Color.ORANGE.


Field Summary
static Color BLACK
           
static Color BLUE
           
static Color BROWN
           
static Color CYAN
           
static Color DARK_BLUE
           
static Color DARK_GRAY
           
static Color DARK_GREEN
           
static Color DARK_RED
           
static Color GRAY
           
static Color GREEN
           
static Color LIGHT_BLUE
           
static Color LIGHT_GRAY
           
static Color LIGHT_GREEN
           
static Color LIGHT_RED
           
static Color MAGENTA
           
static Color ORANGE
           
static Color RED
           
static Color TAN
           
static Color WHITE
           
static Color YELLOW
           
 
Constructor Summary
Color()
          Creates a default black color
Color(double red, double green, double blue)
          Creates a new Color object with the specified
 
Method Summary
 java.awt.Color awt()
          This will convert a color specified for the Phun package into one that is acceptable to java.awt
 double blue()
          returns the blue component of the color.
 double green()
          returns the green component of the color.
 double red()
          returns the red component of the color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIGHT_BLUE

public static final Color LIGHT_BLUE

BLUE

public static final Color BLUE

DARK_BLUE

public static final Color DARK_BLUE

CYAN

public static final Color CYAN

LIGHT_GREEN

public static final Color LIGHT_GREEN

GREEN

public static final Color GREEN

DARK_GREEN

public static final Color DARK_GREEN

LIGHT_RED

public static final Color LIGHT_RED

RED

public static final Color RED

DARK_RED

public static final Color DARK_RED

MAGENTA

public static final Color MAGENTA

ORANGE

public static final Color ORANGE

YELLOW

public static final Color YELLOW

TAN

public static final Color TAN

BROWN

public static final Color BROWN

LIGHT_GRAY

public static final Color LIGHT_GRAY

GRAY

public static final Color GRAY

DARK_GRAY

public static final Color DARK_GRAY

BLACK

public static final Color BLACK

WHITE

public static final Color WHITE
Constructor Detail

Color

public Color()
Creates a default black color


Color

public Color(double red,
             double green,
             double blue)
Creates a new Color object with the specified

Parameters:
red - a value between 0.0 and 1.0 for the red component
green - a value between 0.0 and 1.0 for the green component
blue - a value between 0.0 and 1.0 for the blue component
Method Detail

red

public double red()
returns the red component of the color.

Returns:
A value between 0 and 1.0

green

public double green()
returns the green component of the color.

Returns:
A value between 0 and 1.0

blue

public double blue()
returns the blue component of the color.

Returns:
A value between 0 and 1.0

awt

public java.awt.Color awt()
This will convert a color specified for the Phun package into one that is acceptable to java.awt

Returns:
the corresponding java.awt color object.