org.jtgl.core
Class JTGLColor

java.lang.Object
  extended by org.jtgl.core.JTGLColor

public final class JTGLColor
extends java.lang.Object

Manages Color info (TODO: Color conversion via JTGLColorManager) ColorSpace is sRGB with alpha or opacity information and default 8bits per component

Author:
Manuel Polo (manuel_polo at yahoo dot es)

Field Summary
static JTGLColor BLACK
          The color black.
static JTGLColor BLUE
          The color blue.
static JTGLColor CYAN
          The color cyan.
static JTGLColor DARK_GRAY
          The color dark gray.
static JTGLColor GRAY
          The color gray.
static JTGLColor GREEN
          The color green.
static JTGLColor LIGHT_GRAY
          The color light gray.
static JTGLColor MAGENTA
          The color magenta.
static int MAX_LEVEL
          Defines maximun component level
static int OPAQUE
           
static JTGLColor ORANGE
          The color orange.
static JTGLColor PINK
          The color pink.
static JTGLColor RED
          The color red.
static int TRANSLUCENT
           
static int TRANSPARENT
           
static JTGLColor WHITE
          The color white.
static JTGLColor YELLOW
          The color yellow.
 
Constructor Summary
JTGLColor(byte red, byte green, byte blue)
           
JTGLColor(int red, int green, int blue)
           
JTGLColor(int alpha, int red, int green, int blue)
          Creates a new instance of JTGLColor
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getAlpha()
          Returns the alpha value of the color.
 int getARGB()
          Returns the argb value of the color.
 int getBlue()
          Returns the blue value of the color.
 int getGray()
           
 int getGreen()
          Returns the green value of the color.
 int getRed()
          Returns the red value of the color.
 int getRGB()
          Returns the rgb value of the color.
 int hashCode()
           
 java.lang.String toString()
           
 JTGLColor translucent()
           
 JTGLColor translucent(int level)
           
 JTGLColor transparent()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_LEVEL

public static final int MAX_LEVEL
Defines maximun component level

See Also:
Constant Field Values

OPAQUE

public static final int OPAQUE
See Also:
Constant Field Values

TRANSLUCENT

public static final int TRANSLUCENT
See Also:
Constant Field Values

TRANSPARENT

public static final int TRANSPARENT
See Also:
Constant Field Values

WHITE

public static final JTGLColor WHITE
The color white. In the default sRGB space.


LIGHT_GRAY

public static final JTGLColor LIGHT_GRAY
The color light gray. In the default sRGB space.


GRAY

public static final JTGLColor GRAY
The color gray. In the default sRGB space.


DARK_GRAY

public static final JTGLColor DARK_GRAY
The color dark gray. In the default sRGB space.


BLACK

public static final JTGLColor BLACK
The color black. In the default sRGB space.


RED

public static final JTGLColor RED
The color red. In the default sRGB space.


PINK

public static final JTGLColor PINK
The color pink. In the default sRGB space.


ORANGE

public static final JTGLColor ORANGE
The color orange. In the default sRGB space.


YELLOW

public static final JTGLColor YELLOW
The color yellow. In the default sRGB space.


MAGENTA

public static final JTGLColor MAGENTA
The color magenta. In the default sRGB space.


CYAN

public static final JTGLColor CYAN
The color cyan. In the default sRGB space.


BLUE

public static final JTGLColor BLUE
The color blue. In the default sRGB space.


GREEN

public static final JTGLColor GREEN
The color green. In the default sRGB space.

Constructor Detail

JTGLColor

public JTGLColor(int alpha,
                 int red,
                 int green,
                 int blue)
Creates a new instance of JTGLColor


JTGLColor

public JTGLColor(int red,
                 int green,
                 int blue)

JTGLColor

public JTGLColor(byte red,
                 byte green,
                 byte blue)
Method Detail

getAlpha

public int getAlpha()
Returns the alpha value of the color.


getRed

public int getRed()
Returns the red value of the color.


getGreen

public int getGreen()
Returns the green value of the color.


getBlue

public int getBlue()
Returns the blue value of the color.


getARGB

public int getARGB()
Returns the argb value of the color.


getRGB

public int getRGB()
Returns the rgb value of the color.


getGray

public int getGray()

translucent

public JTGLColor translucent(int level)

translucent

public JTGLColor translucent()

transparent

public JTGLColor transparent()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object