com.threed.jpct
Class RGBColor

java.lang.Object
  extended byjava.awt.Color
      extended bycom.threed.jpct.RGBColor
All Implemented Interfaces:
java.awt.Paint, java.io.Serializable, java.awt.Transparency

public class RGBColor
extends java.awt.Color

Mimics the Color-class in java.awt just like jPCT-AE does it. This class should help to ease porting applications to jPCT-AE (the Android version of jPCT).

See Also:
Serialized Form

Field Summary
static RGBColor BLACK
           
static RGBColor BLUE
           
static RGBColor GREEN
           
static RGBColor RED
           
static RGBColor WHITE
           
 
Fields inherited from class java.awt.Color
black, blue, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, white, yellow, YELLOW
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
RGBColor()
          Creates a new, black color.
RGBColor(int r, int g, int b)
          Creates a new color.
RGBColor(int r, int g, int b, int a)
          Creates a new color with alpha.
 
Method Summary
 int getAlpha()
          Returns the alpha value (0..255).
 int getARGB()
          Returns the color as an int argb value with alpha.
 int getBlue()
          Returns the blue value (0..255).
 int getGreen()
          Returns the green value (0..255).
 float getNormalizedAlpha()
          Returns the alpha value in normalized form (0..1).
 float getNormalizedBlue()
          Returns the blue value in normalized form (0..1).
 float getNormalizedGreen()
          Returns the green value in normalized form (0..1).
 float getNormalizedRed()
          Returns the red value in normalized form (0..1).
 int getRed()
          Returns the red value (0..255).
 int getRGB()
          Returns the color as an int rgb value.
 
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getHSBColor, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final RGBColor BLACK

WHITE

public static final RGBColor WHITE

RED

public static final RGBColor RED

GREEN

public static final RGBColor GREEN

BLUE

public static final RGBColor BLUE
Constructor Detail

RGBColor

public RGBColor()
Creates a new, black color.


RGBColor

public RGBColor(int r,
                int g,
                int b)
Creates a new color. Alpha for this color will be set to 0.

Parameters:
r - red value between 0 and 255
g - green value between 0 and 255
b - blue value between 0 and 255

RGBColor

public RGBColor(int r,
                int g,
                int b,
                int a)
Creates a new color with alpha.

Parameters:
r - red value between 0 and 255
g - green value between 0 and 255
b - blue value between 0 and 255
a - alpha value between 0 and 255
Method Detail

getNormalizedRed

public float getNormalizedRed()
Returns the red value in normalized form (0..1).

Returns:
red

getNormalizedGreen

public float getNormalizedGreen()
Returns the green value in normalized form (0..1).

Returns:
green

getNormalizedBlue

public float getNormalizedBlue()
Returns the blue value in normalized form (0..1).

Returns:
blue

getNormalizedAlpha

public float getNormalizedAlpha()
Returns the alpha value in normalized form (0..1).

Returns:
alpha

getRed

public int getRed()
Returns the red value (0..255).

Returns:
red

getBlue

public int getBlue()
Returns the blue value (0..255).

Returns:
blue

getGreen

public int getGreen()
Returns the green value (0..255).

Returns:
green

getAlpha

public int getAlpha()
Returns the alpha value (0..255).

Returns:
alpha

getRGB

public int getRGB()
Returns the color as an int rgb value.

Returns:
the color

getARGB

public int getARGB()
Returns the color as an int argb value with alpha.

Returns:
the color