## helma.Color

    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

    helma.Color(<Number|String> R, <Number> G, <Number> B)

Constructs a new instance of helma.Color.

Parameters:

`R` - Either the red fraction of the color, or the name of the color.

`G` - The green fraction

`B` - The blue fraction

Returns:

A newly created helma.Color instance

Properties Detail

### COLORNAMES

    <static> <final> Object COLORNAMES

Contains the hexadecimal values of named colors.

### COLORVALUES

    <static> <final> Object COLORVALUES

Contains the color names for specific hex values

Method Detail

### getName

    String getName()

Returns the trivial name of this color

Returns:

The trivial name of this color

### toString

    String toString()

Returns the hexidecimal value of this color (without a leading hash sign).

Returns:

The hexidecimal value of this color

### valueOf

    Number valueOf(<String> channel)

Returns the decimal value of this color, or of a specified color channel.

Parameters:

`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.

### fromHsl

    <static> helma.Color fromHsl(<Number> H,<Number> S,<Number> L)

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:

`H` - The hue fraction of the color definition

`S` - The saturation fraction

`L` - The lightness fraction

Returns:

An instance of helma.Color representing the corresponding RGB color definition.

### fromName

    <static> helma.Color fromName(<String> name)

Creates a new helma.Color instance based on a color name.

Parameters:

`name` - The color name (eg. "darkseagreen")

Returns:

An instance of helma.Color representing the color specified

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007