|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.shared.ui.colorpicker.Color
public class Color
Default implementation for color.
| Field Summary | |
|---|---|
static Color |
BLACK
|
static Color |
BLUE
|
static Color |
CYAN
|
static Color |
GREEN
|
static Color |
MAGENTA
|
static Color |
RED
|
static Color |
WHITE
|
static Color |
YELLOW
|
| Constructor Summary | |
|---|---|
Color(int rgb)
Creates a color based on an RGB value. |
|
Color(int red,
int green,
int blue)
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)
Creates a color that has the specified red, green, blue, and alpha values within the range [0 - 255]. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
int |
getAlpha()
Returns the alpha value of the color. |
int |
getBlue()
Returns the blue value of the color. |
java.lang.String |
getCSS()
Returns CSS representation of the Color, e.g. |
int |
getGreen()
Returns the green value of the color. |
float[] |
getHSV()
Returns converted HSV components of the color. |
int |
getRed()
Returns the red value of the color. |
int |
getRGB()
Returns RGB value of the color. |
int |
hashCode()
|
static int |
HSLtoRGB(int hue,
int saturation,
int lightness)
Converts HSL's hue, saturation and lightness into an RGB value. |
static int |
HSVtoRGB(float hue,
float saturation,
float value)
Converts HSV's hue, saturation and value into an RGB value. |
void |
setAlpha(int alpha)
Sets the alpha value of the color. |
void |
setBlue(int blue)
Sets the blue value of the color. |
void |
setGreen(int green)
Sets the green value of the color. |
void |
setRed(int red)
Sets the red value of the color. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Color WHITE
public static final Color BLACK
public static final Color RED
public static final Color GREEN
public static final Color BLUE
public static final Color YELLOW
public static final Color MAGENTA
public static final Color CYAN
| Constructor Detail |
|---|
public Color(int red,
int green,
int blue,
int alpha)
red - the red valuegreen - the green valueblue - the blue valuealpha - the alpha value
java.lang.IllegalArgumentException - if red, green, blue or
alpha fall outside of the inclusive range from 0
to 255
public Color(int red,
int green,
int blue)
red - the red valuegreen - the green valueblue - the blue value
java.lang.IllegalArgumentException - if red, green or blue
fall outside of the inclusive range from 0 to 255public Color(int rgb)
rgb - the RGB value
java.lang.IllegalArgumentException - if converted values of red, green,
blue or alpha fall outside of the
inclusive range from 0 to 255| Method Detail |
|---|
public int getRed()
public void setRed(int red)
red - new red valuepublic int getGreen()
public void setGreen(int green)
green - new green valuepublic int getBlue()
public void setBlue(int blue)
blue - new blue valuepublic int getAlpha()
public void setAlpha(int alpha)
alpha - new alpha valuepublic java.lang.String getCSS()
public int getRGB()
public float[] getHSV()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public static int HSVtoRGB(float hue,
float saturation,
float value)
Converts HSV's hue, saturation and value into an RGB value.
The saturation and value components should be
floating-point values within the range [0.0-1.0].
hue - the hue of the colorsaturation - the saturation of the colorvalue - the value of the color
public static int HSLtoRGB(int hue,
int saturation,
int lightness)
Converts HSL's hue, saturation and lightness into an RGB value.
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;
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||