|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.byu.phun2d.Color
public class Color
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 |
---|
public static final Color LIGHT_BLUE
public static final Color BLUE
public static final Color DARK_BLUE
public static final Color CYAN
public static final Color LIGHT_GREEN
public static final Color GREEN
public static final Color DARK_GREEN
public static final Color LIGHT_RED
public static final Color RED
public static final Color DARK_RED
public static final Color MAGENTA
public static final Color ORANGE
public static final Color YELLOW
public static final Color TAN
public static final Color BROWN
public static final Color LIGHT_GRAY
public static final Color GRAY
public static final Color DARK_GRAY
public static final Color BLACK
public static final Color WHITE
Constructor Detail |
---|
public Color()
public Color(double red, double green, double blue)
red
- a value between 0.0 and 1.0 for the red componentgreen
- a value between 0.0 and 1.0 for the green componentblue
- a value between 0.0 and 1.0 for the blue componentMethod Detail |
---|
public double red()
public double green()
public double blue()
public java.awt.Color awt()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |