Class Color
java.lang.Object
java.awt.Color
org.scilab.forge.scirenderer.shapes.appearance.Color
- All Implemented Interfaces:
Paint
,Transparency
,Serializable
- Author:
- Pierre Lando
- See Also:
-
Field Summary
Fields inherited from class java.awt.Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
Constructor Summary
ConstructorsConstructorDescriptionColor()
Default constructor.Color
(float r, float g, float b) Creates an opaque sRGB color with the specified red, green, and blue values in the range [0.0; 1.0].Color
(float r, float g, float b, float a) Creates an sRGB color with the specified red, green, blue, and alpha values in the range [0.0; 1.0].Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return alpha component value.float
Return blue component value.float
Return green component value.float
Return red component value.Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString
-
Constructor Details
-
Color
public Color()Default constructor. Create a copy of the default color. -
Color
Copy constructor- Parameters:
c
- the color to copy.
-
Color
public Color(float r, float g, float b, float a) Creates an sRGB color with the specified red, green, blue, and alpha values in the range [0.0; 1.0]. The actual color used in rendering depends on finding the best match given the color space available for a particular output device.- Parameters:
r
- the red componentg
- the green componentb
- the blue componenta
- the alpha component
-
Color
public Color(float r, float g, float b) Creates an opaque sRGB color with the specified red, green, and blue values in the range [0.0; 1.0]. Alpha is defaulted to 1.0. The actual color used in rendering depends on finding the best match given the color space available for a particular output device.- Parameters:
r
- the red componentg
- the green componentb
- the blue component
-
-
Method Details
-
getRedAsFloat
public float getRedAsFloat()Return red component value. In the range [0; 1].- Returns:
- red component value. In the range [0; 1].
-
getGreenAsFloat
public float getGreenAsFloat()Return green component value. In the range [0; 1].- Returns:
- green component value. In the range [0; 1].
-
getBlueAsFloat
public float getBlueAsFloat()Return blue component value. In the range [0; 1].- Returns:
- blue component value. In the range [0; 1].
-
getAlphaAsFloat
public float getAlphaAsFloat()Return alpha component value. In the range [0; 1].- Returns:
- alpha component value. In the range [0; 1].
-