fhm.edu.fem.animation
Class GLColor

java.lang.Object
  extended by java.awt.Color
      extended by fhm.edu.fem.animation.GLColor
All Implemented Interfaces:
java.awt.Paint, java.awt.Transparency, java.io.Serializable

public class GLColor
extends java.awt.Color

Class Description: This class extends itself from the Java Color class and overrides the getRed, getGreen, getBlue Methods to actually serve color values from (0.0 - 1.0) instead of (0 - 255)

Author:
Thomas Woellert (thomas.woellert@t-online.de), Stefan Weissbach (weissbst@gmx.de)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
GLColor(int r, int g, int b)
          Constructor
 
Method Summary
 float getBlueGL()
          Get the blue color as 0.0 - 1.0 value
 float getGreenGL()
          Get the green color as 0.0 - 1.0 value
 float getRedGL()
          Get the red color as 0.0 - 1.0 value
protected  float transformColorValue(double value)
          Transform the color value from 0 - 255 to 0.0 - 1.0
 
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GLColor

public GLColor(int r,
               int g,
               int b)
Constructor

Parameters:
r, - the red component of the color (0 - 255)
g, - the green component of the color (0 - 255)
b, - the blue component of the color (0 - 255)
Method Detail

getBlueGL

public float getBlueGL()
Get the blue color as 0.0 - 1.0 value

Returns:
the color

getGreenGL

public float getGreenGL()
Get the green color as 0.0 - 1.0 value

Returns:
the color

getRedGL

public float getRedGL()
Get the red color as 0.0 - 1.0 value

Returns:
the color

transformColorValue

protected float transformColorValue(double value)
Transform the color value from 0 - 255 to 0.0 - 1.0

Parameters:
value, - the 0 - 255 color value
Returns:
the 0.0 - 1.0 color value