org.openuat.util
Class RgbColor

java.lang.Object
  extended by org.openuat.util.RgbColor

public class RgbColor
extends java.lang.Object

This class represents an opaque RGB color encoded as an int value of the form 0xRRGGBB. Additionally it provides some predefined color values.
It's intended to be used mainly within J2ME since J2SE (AWT) brings its own Color class.

Version:
1.0
Author:
Lukas Huser

Field Summary
static int BLACK
          The color black (0x000000).
static int BLUE
          The color blue (0x0000ff).
static int CYAN
          The color cyan (0x00ffff).
static int DARK_BLUE
          The color dark blue (0x0000a0).
static int DARK_GRAY
          The color dark gray (0x404040).
static int DARK_GREEN
          The color dark green (0x008000).
static int DARK_RED
          The color dark red (0x800000).
static int GRAY
          The color gray (0x808080).
static int GREEN
          The color green (0x00ff00).
static int LIGHT_GRAY
          The color light gray (0xc0c0c0).
static int LIGHT_RED
          The color light red (0xff3333).
static int MAGENTA
          The color magenta (0xff00ff).
static int RED
          The color red (0xff0000).
static int WHITE
          The color white (0xffffff).
static int YELLOW
          The color yellow (0xffff00).
 
Constructor Summary
RgbColor()
          Creates a new color.
RgbColor(int rgbValue)
          Creates a new color from a given RGB representation.
 
Method Summary
 int getRgbValue()
          Gets the RGB representation of the color.
 void setRgbValue(int rgbValue)
          Sets the RGB representation of the color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

public static final int BLACK
The color black (0x000000).

See Also:
Constant Field Values

WHITE

public static final int WHITE
The color white (0xffffff).

See Also:
Constant Field Values

RED

public static final int RED
The color red (0xff0000).

See Also:
Constant Field Values

GREEN

public static final int GREEN
The color green (0x00ff00).

See Also:
Constant Field Values

BLUE

public static final int BLUE
The color blue (0x0000ff).

See Also:
Constant Field Values

YELLOW

public static final int YELLOW
The color yellow (0xffff00).

See Also:
Constant Field Values

CYAN

public static final int CYAN
The color cyan (0x00ffff).

See Also:
Constant Field Values

MAGENTA

public static final int MAGENTA
The color magenta (0xff00ff).

See Also:
Constant Field Values

GRAY

public static final int GRAY
The color gray (0x808080).

See Also:
Constant Field Values

DARK_GRAY

public static final int DARK_GRAY
The color dark gray (0x404040).

See Also:
Constant Field Values

LIGHT_GRAY

public static final int LIGHT_GRAY
The color light gray (0xc0c0c0).

See Also:
Constant Field Values

DARK_RED

public static final int DARK_RED
The color dark red (0x800000).

See Also:
Constant Field Values

LIGHT_RED

public static final int LIGHT_RED
The color light red (0xff3333).

See Also:
Constant Field Values

DARK_GREEN

public static final int DARK_GREEN
The color dark green (0x008000).

See Also:
Constant Field Values

DARK_BLUE

public static final int DARK_BLUE
The color dark blue (0x0000a0).

See Also:
Constant Field Values
Constructor Detail

RgbColor

public RgbColor()
Creates a new color. The default color is black.


RgbColor

public RgbColor(int rgbValue)
Creates a new color from a given RGB representation.

Parameters:
rgbValue - The RGB representation of the new color.
Method Detail

getRgbValue

public int getRgbValue()
Gets the RGB representation of the color.

Returns:
Returns the RGB representation of the color.

setRgbValue

public void setRgbValue(int rgbValue)
Sets the RGB representation of the color.

Parameters:
rgbValue - The RGB representation of the color.


2005-2009, Rene Mayrhofer.