Class Color
- java.lang.Object
-
- com.vaadin.v7.shared.ui.colorpicker.Color
-
- All Implemented Interfaces:
Serializable
@Deprecated public class Color extends Object implements Serializable
Deprecated.Default implementation for color.- Since:
- 7.0.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ColorBLACKDeprecated.static ColorBLUEDeprecated.static ColorCYANDeprecated.static ColorGREENDeprecated.static ColorMAGENTADeprecated.static ColorREDDeprecated.static ColorWHITEDeprecated.static ColorYELLOWDeprecated.
-
Constructor Summary
Constructors Constructor Description Color(int rgb)Deprecated.Creates a color based on an RGB value.Color(int red, int green, int blue)Deprecated.Creates a color that has the specified red, green, and blue values within the range [0 - 255].Color(int red, int green, int blue, int alpha)Deprecated.Creates a color that has the specified red, green, blue, and alpha values within the range [0 - 255].
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Deprecated.intgetAlpha()Deprecated.Returns the alpha value of the color.intgetBlue()Deprecated.Returns the blue value of the color.StringgetCSS()Deprecated.Returns CSS representation of the Color, e.g. #000000.intgetGreen()Deprecated.Returns the green value of the color.float[]getHSV()Deprecated.Returns converted HSV components of the color.intgetRed()Deprecated.Returns the red value of the color.intgetRGB()Deprecated.Returns RGB value of the color.inthashCode()Deprecated.static intHSLtoRGB(int hue, int saturation, int lightness)Deprecated.Converts HSL's hue, saturation and lightness into an RGB value.static intHSVtoRGB(float hue, float saturation, float value)Deprecated.Converts HSV's hue, saturation and value into an RGB value.voidsetAlpha(int alpha)Deprecated.Sets the alpha value of the color.voidsetBlue(int blue)Deprecated.Sets the blue value of the color.voidsetGreen(int green)Deprecated.Sets the green value of the color.voidsetRed(int red)Deprecated.Sets the red value of the color.
-
-
-
Field Detail
-
WHITE
public static final Color WHITE
Deprecated.
-
BLACK
public static final Color BLACK
Deprecated.
-
RED
public static final Color RED
Deprecated.
-
GREEN
public static final Color GREEN
Deprecated.
-
BLUE
public static final Color BLUE
Deprecated.
-
YELLOW
public static final Color YELLOW
Deprecated.
-
MAGENTA
public static final Color MAGENTA
Deprecated.
-
CYAN
public static final Color CYAN
Deprecated.
-
-
Constructor Detail
-
Color
public Color(int red, int green, int blue, int alpha)Deprecated.Creates a color that has the specified red, green, blue, and alpha values within the range [0 - 255].- Parameters:
red- the red valuegreen- the green valueblue- the blue valuealpha- the alpha value- Throws:
IllegalArgumentException- ifred,green,blueoralphafall outside of the inclusive range from 0 to 255
-
Color
public Color(int red, int green, int blue)Deprecated.Creates a color that has the specified red, green, and blue values within the range [0 - 255]. Alpha gets the default value of 255.- Parameters:
red- the red valuegreen- the green valueblue- the blue value- Throws:
IllegalArgumentException- ifred,greenorbluefall outside of the inclusive range from 0 to 255
-
Color
public Color(int rgb)
Deprecated.Creates a color based on an RGB value.- Parameters:
rgb- the RGB value- Throws:
IllegalArgumentException- if converted values ofred,green,blueoralphafall outside of the inclusive range from 0 to 255
-
-
Method Detail
-
getRed
public int getRed()
Deprecated.Returns the red value of the color.
-
setRed
public void setRed(int red)
Deprecated.Sets the red value of the color. Value must be within the range [0, 255].- Parameters:
red- new red value
-
getGreen
public int getGreen()
Deprecated.Returns the green value of the color.
-
setGreen
public void setGreen(int green)
Deprecated.Sets the green value of the color. Value must be within the range [0, 255].- Parameters:
green- new green value
-
getBlue
public int getBlue()
Deprecated.Returns the blue value of the color.
-
setBlue
public void setBlue(int blue)
Deprecated.Sets the blue value of the color. Value must be within the range [0, 255].- Parameters:
blue- new blue value
-
getAlpha
public int getAlpha()
Deprecated.Returns the alpha value of the color.
-
setAlpha
public void setAlpha(int alpha)
Deprecated.Sets the alpha value of the color. Value must be within the range [0, 255].- Parameters:
alpha- new alpha value
-
getCSS
public String getCSS()
Deprecated.Returns CSS representation of the Color, e.g. #000000.
-
getRGB
public int getRGB()
Deprecated.Returns RGB value of the color.
-
getHSV
public float[] getHSV()
Deprecated.Returns converted HSV components of the color.
-
HSVtoRGB
public static int HSVtoRGB(float hue, float saturation, float value)Deprecated.Converts HSV's hue, saturation and value into an RGB value.
The
saturationandvaluecomponents should be floating-point values within the range [0.0-1.0].- Parameters:
hue- the hue of the colorsaturation- the saturation of the colorvalue- the value of the color- Returns:
- the RGB value of corresponding color
-
HSLtoRGB
public static int HSLtoRGB(int hue, int saturation, int lightness)Deprecated.Converts HSL's hue, saturation and lightness into an RGB value.
- Parameters:
hue- the hue of the color. The unit of the value is degrees and should be between 0-360.saturation- the saturation of the color. The unit of the value is percentages and should be between 0-100;lightness- the lightness of the color. The unit of the value is percentages and should be between 0-100;- Returns:
- the RGB value of corresponding color
-
-