mako5.gfx
Class Color

java.lang.Object
  extended by mako5.gfx.Color
All Implemented Interfaces:
Cloneable

public final class Color
extends Object
implements Cloneable

A color that may be applied.

Version:
03-Feb 2006
Author:
Paul Jarrett

Field Summary
static Color YELLOW
           
 
Constructor Summary
Color(Color c)
          Makes a copy of another color.
Color(float fRed_, float fGreen_, float fBlue_)
          Makes a new color.
Color(float fRed_, float fGreen_, float fBlue_, float fAlpha_)
          Makes a new color.
 
Method Summary
 Object clone()
          Clones this color.
 float getAlpha()
          Returns the alpha component.
 float getBlue()
          Returns the blue component.
 float getGreen()
          Returns the green component.
 float getRed()
          Returns the red component.
 void glApply()
          Sets this as the current color for openGL.
 void set(Color rColor_)
          Sets this color equal to another color.
 void set(float r, float g, float b, float a)
          Sets the color components of this.
 void setAlpha(float fAlpha_)
          Changes the alpha component.
 void setBlue(float fBlue_)
          Changes the blue component.
 void setGreen(float fGreen_)
          Changes the green component.
 void setRed(float fRed_)
          Changes the red component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YELLOW

public static final Color YELLOW
Constructor Detail

Color

public Color(float fRed_,
             float fGreen_,
             float fBlue_,
             float fAlpha_)
Makes a new color.


Color

public Color(float fRed_,
             float fGreen_,
             float fBlue_)
Makes a new color. Uses 1.0 as the alpha component.


Color

public Color(Color c)
Makes a copy of another color.

Method Detail

clone

public Object clone()
Clones this color.

Overrides:
clone in class Object

glApply

public void glApply()
Sets this as the current color for openGL.


setRed

public void setRed(float fRed_)
Changes the red component.


setGreen

public void setGreen(float fGreen_)
Changes the green component.


setBlue

public void setBlue(float fBlue_)
Changes the blue component.


setAlpha

public void setAlpha(float fAlpha_)
Changes the alpha component.


set

public void set(Color rColor_)
Sets this color equal to another color.

Parameters:
rColor_ - the target color to copy

set

public void set(float r,
                float g,
                float b,
                float a)
Sets the color components of this.

Since:
11-Mar 2006

getRed

public float getRed()
Returns the red component.

Returns:
the red component

getGreen

public float getGreen()
Returns the green component.

Returns:
the green component

getBlue

public float getBlue()
Returns the blue component.

Returns:
the blue component

getAlpha

public float getAlpha()
Returns the alpha component.

Returns:
the alpha component