Package org.jzy3d.colors
Class Color
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description float
a
float
b
static Color
BLACK
Black color.static Color
BLUE
Blue color.static Color[]
COLORS
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.static Random
rng
static Color
WHITE
White color.static Color
YELLOW
Yellow color.
-
Constructor Summary
Constructors Constructor Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
alpha(float alpha)
Color
alphaSelf(float alpha)
Color
clone()
static Color
color(int c)
Returns one of the main color based on id.Color
mul(Color factor)
Color
mulSelf(float ratio)
Color
negative()
Color
negativeSelf()
static Color
random()
float[]
toArray()
String
toHex()
Return the hexadecimal representation of this color.String
toString()
-
-
-
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.
-
COLORS
public static final Color[] COLORS
-
rng
public 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, 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.
-
-
Method Detail
-
alphaSelf
public Color alphaSelf(float alpha)
-
alpha
public Color alpha(float alpha)
-
mulSelf
public Color mulSelf(float ratio)
-
toHex
public String toHex()
Return the hexadecimal representation of this color.
-
toArray
public float[] toArray()
-
negative
public Color negative()
-
negativeSelf
public Color negativeSelf()
-
random
public static Color random()
-
color
public static Color color(int c)
Returns one of the main color based on id. Use id%(#colors)
-
-