Package com.storedobject.chart
Class Color
java.lang.Object
com.storedobject.chart.AbstractColor
com.storedobject.chart.Color
- All Implemented Interfaces:
ComponentProperty
Representation of color. A color is represented using its RGBA values. RGB values should be between 0 and 255. Alpha
values is a percentage value and must be in the range 0 to 100.
- Author:
- Syam
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()voidset(int red, int green, int blue) Set RGB values.voidset(int red, int green, int blue, int alpha) Set RGBA values.voidSet the values from a given hex value.voidsetAlpha(int alpha) Set the alpha value.voidsetBlue(int blue) Set the blue value.voidsetGreen(int green) Set the green value.voidsetRed(int red) Set the red value.toString()Methods inherited from class com.storedobject.chart.AbstractColor
encodeJSON
-
Field Details
-
TRANSPARENT
Transparent color.
-
-
Constructor Details
-
Color
public Color(int red, int green, int blue) Constructor. (Alpha value will be set to 100).- Parameters:
red- Red value.green- Green value.blue- Blue value.
-
Color
public Color(int red, int green, int blue, int alpha) Constructor.- Parameters:
red- Red value.green- Green value.blue- Blue value.alpha- Alpha value.
-
Color
Construct from an hex value. (Also accepts rgb(...), hsl(...) or standard HTML color names like "red", "green" etc. here).- Parameters:
hexValue- Hex value of the color. (Example: FF0000 for red).
-
-
Method Details
-
set
public void set(int red, int green, int blue) Set RGB values. (Alpha value will be set to 100).- Parameters:
red- Red value.green- Green value.blue- Blue value.
-
set
public void set(int red, int green, int blue, int alpha) Set RGBA values.- Parameters:
red- Red value.green- Green value.blue- Blue value.alpha- Alpha value.
-
set
Set the values from a given hex value. (Also accepts rgb(...), hsl(...) or standard HTML color names like "red", "green" etc.).- Parameters:
hexValue- Hex value of the color. (Example: FF0000 for red).
-
setAlpha
public void setAlpha(int alpha) Set the alpha value.- Parameters:
alpha- The alpha value.
-
setRed
public void setRed(int red) Set the red value.- Parameters:
red- The red value.
-
setGreen
public void setGreen(int green) Set the green value.- Parameters:
green- The green value.
-
setBlue
public void setBlue(int blue) Set the blue value.- Parameters:
blue- The blue value.
-
toString
-
equals
-
hashCode
-