org.jzy3d.colors
Class Color
- java.lang.Object
-
- org.jzy3d.colors.Color
-
public class Color extends java.lang.ObjectColor interface.The Color interface provide a representation of a color, independant from the target Window Toolkit (AWT, SWT, etc).
-
-
Field Summary
Fields Modifier and Type Field and 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 java.util.Randomrngstatic ColorWHITEWhite color.static ColorYELLOWYellow color.
-
Constructor Summary
Constructors Constructor and Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description ColoralphaSelf(float alpha)Colorclone()static Colorcolor(int c)Returns one of the main color based on id.voidmul(Color factor)Colornegative()ColornegativeSelf()static Colorrandom()float[]toArray()java.lang.StringtoHex()Return the hexadecimal representation of this color.java.lang.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 java.util.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.
-
-
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:
toStringin classjava.lang.Object
-
clone
public Color clone()
- Overrides:
clonein classjava.lang.Object
-
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)
-
-
DMelt 3.0 © DataMelt by jWork.ORG