org.jzy3d.colors
Class Color

java.lang.Object
  extended by org.jzy3d.colors.Color

public class Color
extends Object

Color interface.

The Color interface provide a representation of a color, independant from the target Window Toolkit (AWT, SWT, etc).

Author:
Martin Pernollet

Field Summary
 float a
           
 float b
           
static Color BLACK
          Black color.
static Color BLUE
          Blue color.
static Color CYAN
          Cyan color.
 float g
           
static Color GRAY
          Gray color.
static Color GREEN
          Green color.
static Color MAGENTA
          Magenta color.
 float r
           
static Color RED
          Red color.
protected static Random rng
           
static Color WHITE
          White color.
static Color YELLOW
          Yellow color.
 
Constructor Summary
Color(Color c)
           
Color(float r, float g, float b)
          Initialize a color with an alpha channel set to 1.
Color(float r, float g, float b, float a)
          Initialize a color with values between 0 and 1.
Color(int r, int g, int b)
          Initialize a color with an alpha channel set to 255.
Color(int r, int g, int b, int a)
          Initialize a color with values between 0 and 255.
 
Method Summary
 Color alphaSelf(float alpha)
           
 Color awt()
           
 Color clone()
           
 void mul(Color factor)
           
 Color negative()
           
static Color random()
           
 float[] toArray()
           
 String toHex()
          Return the hexadecimal representation of this color.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final Color BLACK
Black color.


WHITE

public static final Color WHITE
White color.


GRAY

public static final Color GRAY
Gray color.


RED

public static final Color RED
Red color.


GREEN

public static final Color GREEN
Green color.


BLUE

public static final Color BLUE
Blue color.


YELLOW

public static final Color YELLOW
Yellow color.


MAGENTA

public static final Color MAGENTA
Magenta color.


CYAN

public static final Color CYAN
Cyan color.


rng

protected static Random rng

r

public float r

g

public float g

b

public float b

a

public float a
Constructor Detail

Color

public Color(float r,
             float g,
             float b)
Initialize a color with an alpha channel set to 1.


Color

public Color(int r,
             int g,
             int b)
Initialize a color with an alpha channel set to 255.


Color

public Color(float r,
             float g,
             float b,
             float a)
Initialize a color with values between 0 and 1.


Color

public Color(int r,
             int g,
             int b,
             int a)
Initialize a color with values between 0 and 255.


Color

public Color(Color c)
Method Detail

mul

public void mul(Color factor)

alphaSelf

public Color alphaSelf(float alpha)

toHex

public String toHex()
Return the hexadecimal representation of this color.


toString

public String toString()
Overrides:
toString in class Object

clone

public Color clone()
Overrides:
clone in class Object

toArray

public float[] toArray()

negative

public Color negative()

random

public static Color random()

awt

public Color awt()