org.vostok.vaadin.addon.dialog
Class ColourCss

java.lang.Object
  extended by com.vaadin.shared.ui.colorpicker.Color
      extended by 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 :

Author:
levreau.jerome@vostoksystem.eu
See Also:
Serialized Form

Field Summary
 
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
 

Constructor Detail

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
Method Detail

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