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 floatafloatbstatic ColorBLACKBlack color.static ColorBLUEBlue color.static Color[]COLORSstatic ColorCYANCyan color.floatgstatic ColorGRAYGray color.static ColorGREENGreen color.static ColorMAGENTAMagenta color.floatrstatic ColorREDRed color.static Randomrngstatic ColorWHITEWhite color.static ColorYELLOWYellow 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 Coloralpha(float alpha)ColoralphaSelf(float alpha)Colorclone()static Colorcolor(int c)Returns one of the main color based on id.Colormul(Color factor)ColormulSelf(float ratio)Colornegative()ColornegativeSelf()static Colorrandom()float[]toArray()StringtoHex()Return the hexadecimal representation of this color.StringtoString()
-
-
-
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)
-
-