org.jzy3d.colors
Class Color

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

public class Color
extends java.lang.Object

Color provides a representation of a color. The color representation relies on a set of float components with values in the range [0;1]. When using the integer constructor of Color, values are expected to stand in [0;255] and are scaled to be maintained in [0;1] afterward. Beside being a convenient container, Color also:

Author:
Martin Pernollet

Field Summary
 float a
           
 float b
           
static Color BLACK
           
static Color BLUE
           
static Color CYAN
           
 float g
           
static Color GRAY
           
static Color GREEN
           
static Color MAGENTA
           
 float r
           
static Color RED
           
static Color WHITE
           
static Color YELLOW
           
 
Constructor Summary
Color(java.awt.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)
           
 java.awt.Color awt()
           
 Color clone()
           
 void mul(Color factor)
           
 Color negative()
           
static Color random()
           
 float[] toArray()
           
 java.lang.String toHex()
          Return the hexadecimal representation of this color.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLACK

public static final Color BLACK

WHITE

public static final Color WHITE

GRAY

public static final Color GRAY

RED

public static final Color RED

GREEN

public static final Color GREEN

BLUE

public static final Color BLUE

YELLOW

public static final Color YELLOW

MAGENTA

public static final Color MAGENTA

CYAN

public static final Color CYAN

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(java.awt.Color c)
Method Detail

mul

public void mul(Color factor)

alphaSelf

public Color alphaSelf(float alpha)

toHex

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


toString

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

clone

public Color clone()
Overrides:
clone in class java.lang.Object

toArray

public float[] toArray()

negative

public Color negative()

random

public static Color random()

awt

public java.awt.Color awt()