org.vostok.vaadin.addon.dialog
Class ColourCss
java.lang.Object
com.vaadin.shared.ui.colorpicker.Color
org.vostok.vaadin.addon.dialog.ColourCss
- All Implemented Interfaces:
- java.io.Serializable
public class ColourCss
- extends com.vaadin.shared.ui.colorpicker.Color
This is a com.vaadin.shared.ui.colorpicker.Color which provides new methods for colour values from/to css string format. This is a com.vaadin.shared.ui.colorpicker.Color which provides new methods
for colour values from/to css string format. Full backward compatible.
Format supported :
- rgba : Accept string in the form rgba(red,green,blue,alpa), each channel in base 10. Ex : rgba(250,140,88,0.55)
- Net : Accept string in the form #FA8C58. each channel must be in base 16, note #EEE is not a valid format, must be #EEEEEE.
- Author:
- levreau.jerome@vostoksystem.eu
- See Also:
- Serialized Form
Fields inherited from class com.vaadin.shared.ui.colorpicker.Color |
BLACK, BLUE, CYAN, GREEN, MAGENTA, RED, WHITE, YELLOW |
Constructor Summary |
ColourCss(int rgb)
|
ColourCss(int red,
int green,
int blue)
|
ColourCss(int red,
int green,
int blue,
int alpha)
|
ColourCss(java.lang.String css)
Passe String into ColourCss. |
Method Summary |
static ColourCss |
getColorCss(com.vaadin.shared.ui.colorpicker.Color color)
create a new ColourCss from a Color object |
java.lang.String |
getNetCss()
Return a net #rrggbb string (no ";" added ) |
java.lang.String |
getRgbaCss()
return an rgba(r,g,b,a) string. |
Methods inherited from class com.vaadin.shared.ui.colorpicker.Color |
equals, getAlpha, getBlue, getCSS, getGreen, getHSV, getRed, getRGB, hashCode, HSLtoRGB, HSVtoRGB, setAlpha, setBlue, setGreen, setRed |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
ColourCss
public ColourCss(int red,
int green,
int blue,
int alpha)
ColourCss
public ColourCss(int red,
int green,
int blue)
ColourCss
public ColourCss(int rgb)
ColourCss
public ColourCss(java.lang.String css)
- Passe String into ColourCss. Accepted format : rgba(r,g,b,a) where r,g,b are in decimal radix and a in float format, #rrggbb where rr,bb,gg, are in hexa radix.
If format is wrong, won't fail, just init to 0 (black). String can en with ";"
- Parameters:
css
- String
to convert
getRgbaCss
public java.lang.String getRgbaCss()
- return an rgba(r,g,b,a) string. (no ";" added )
- Returns:
String
in rgba(r,g,b,a) format
getNetCss
public java.lang.String getNetCss()
- Return a net #rrggbb string (no ";" added )
- Returns:
String
in #rrggbb format
getColorCss
public static ColourCss getColorCss(com.vaadin.shared.ui.colorpicker.Color color)
- create a new ColourCss from a Color object
- Parameters:
color
- object to "convert"
- Returns:
ColourCss