Package org.jzy3d.colors
Class Color
java.lang.Object
org.jzy3d.colors.Color
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionColor
(double r, double g, double b) Color
(double r, double g, double b, double a) Color
(float r, float g, float b) Initialize a color with an alpha channel set to 1, using input values between 0.0 and 1.0.Color
(float r, float g, float b, float a) Initialize a color with input values between 0.0 and 1.0.Color
(int r, int g, int b) Initialize a color with an alpha channel set to 1, using input values between 0 and 255.Color
(int r, int g, int b, int a) Initialize a color with values between 0 and 255. -
Method Summary
Modifier and TypeMethodDescriptionalpha
(float alpha) alphaSelf
(float alpha) clone()
static Color
color
(int c) Returns one of the main color based on id.double
Compute the distance between two colors.double
distanceSq
(Color c) Compute the square distance between two colors.divSelf
(float ratio) divSelfWithAlpha
(float ratio) mulSelf
(float ratio) mulSelfWithAlpha
(float ratio) negative()
static Color
random()
Deprecated.float[]
toArray()
toHex()
Return the hexadecimal representation of this color.toString()
-
Field Details
-
BLACK
-
WHITE
-
GRAY
-
RED
-
GREEN
-
BLUE
-
YELLOW
-
MAGENTA
-
CYAN
-
ORANGE
-
COLORS
-
r
public float r -
g
public float g -
b
public float b -
a
public float a -
rng
-
-
Constructor Details
-
Color
public Color(float r, float g, float b) Initialize a color with an alpha channel set to 1, using input values between 0.0 and 1.0. -
Color
public Color(int r, int g, int b) Initialize a color with an alpha channel set to 1, using input values between 0 and 255. -
Color
public Color(float r, float g, float b, float a) Initialize a color with input values between 0.0 and 1.0. -
Color
public Color(int r, int g, int b, int a) Initialize a color with values between 0 and 255. -
Color
public Color(double r, double g, double b) -
Color
public Color(double r, double g, double b, double a)
-
-
Method Details
-
mul
-
mulSelf
-
mulSelfWithAlpha
-
div
-
divSelf
-
divSelfWithAlpha
-
alphaSelf
-
alpha
-
toHex
Return the hexadecimal representation of this color. -
toString
-
clone
-
toArray
public float[] toArray() -
negative
-
negativeSelf
-
random
Deprecated.UseRandomGeom.color()
instead. -
color
Returns one of the main color based on id. Use id%(#colors) -
distance
Compute the distance between two colors. -
distanceSq
Compute the square distance between two colors. -
add
-