Object | +--helma.Color
Instances of this class provide methods for
converting HTML color names into their corresponding
RGB values and vice versa, or retrieving single RGB color values.
Defined in Color.js
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Constructor Summary | |
helma.Color(<Number|String> R, <Number> G, <Number> B)
Constructs a new instance of helma.Color. |
|
| Properties Summary | |
<static> <final> Object |
COLORNAMES
Contains the hexadecimal values of named colors. |
<static> <final> Object |
COLORVALUES
Contains the color names for specific hex values |
| Methods Summary | |
String
|
getName()
Returns the trivial name of this color |
String
|
toString()
Returns the hexidecimal value of this color (without a leading hash sign). |
Number
|
valueOf(<String> channel)
Returns the decimal value of this color, or of a specified color channel. |
<static> helma.Color
|
fromHsl(<Number> H,<Number> S,<Number> L)
Creates a new helma.Color instance based on a HSL color representation. |
<static> helma.Color
|
fromName(<String> name)
Creates a new helma.Color instance based on a color name. |
| Constructor Detail |
helma.Color(<Number|String> R, <Number> G, <Number> B)
R - Either the red fraction of the color, or the name of the color.
G - The green fraction
B - The blue fraction
| Properties Detail |
<static> <final> Object COLORNAMES
<static> <final> Object COLORVALUES
| Method Detail |
String getName()
String toString()
Number valueOf(<String> channel)
channel - An optional color channel which decimal value should be returned. Must be either "red", "green" or "blue". If no channel is specified this method returns the decimal value of the color itself.
<static> helma.Color fromHsl(<Number> H,<Number> S,<Number> L)
H - The hue fraction of the color definition
S - The saturation fraction
L - The lightness fraction
<static> helma.Color fromName(<String> name)
name - The color name (eg. "darkseagreen")
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |