Fields and methods of the helma.Chart prototype
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Color.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Color.js')
Constructs a new instance of helma.Color.
parameters
| Number, String | R | Either the red fraction of the color, or the name of the color. |
| Number | G | The green fraction |
| Number | B | The blue fraction |
methods
- valueOf(channel)
- toString()
- getName()
Contains the hexadecimal values of named colors.
Contains the color names for specific hex values
Methods
Returns the decimal value of this color, or of a specified
color channel.
parameters
| String | 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. |
returns
| The decimal value of this color or a single channel. |
Returns the hexidecimal value of this color (without
a leading hash sign).
returns
| The hexidecimal value of this color |
Returns the trivial name of this color
returns
| The trivial name of this color |
Creates a new helma.Color instance based on a color name.
parameters
| String | name | The color name (eg. "darkseagreen") |
returns
| An instance of helma.Color representing the color specified |
Creates a new helma.Color instance based on a HSL color
representation. This method is adapted from the HSLtoRGB
conversion method as described at
http://www1.tip.nl/~t876506/ColorDesign.html#hr.
parameters
| Number | H | The hue fraction of the color definition |
| Number | S | The saturation fraction |
| Number | L | The lightness fraction |
returns
| An instance of helma.Color representing the corresponding RGB color definition. |
