Methods
fromCIE(x, y, brightness) → {HueColor}
Constructs a new Color given a CIE point and brightness.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | X coordinate. |
y |
Number | Y coordinate. |
brightness |
Number | Brightness, from 0 to 254. |
Returns:
- Type
- HueColor
fromHex(hex) → {HueColor}
Constructs a new Color given a CSS-style hex code.
Parameters:
Name | Type | Description |
---|---|---|
hex |
String | The hex code. |
Returns:
- Type
- HueColor
fromHsb(hue, saturation, brightness) → {HueColor}
Constructs a new Color given HSB values.
Parameters:
Name | Type | Description |
---|---|---|
hue |
number | Integer, 0 to 65535 |
saturation |
number | Integer, 0 to 254 |
brightness |
number | Integer, 0 to 254 |
Returns:
- Type
- HueColor
fromRgb(red, green, blue) → {HueColor}
Constructs a new Color given red, green, and blue.
Parameters:
Name | Type | Description |
---|---|---|
red |
Number | The red value, from 0 to 255. |
green |
Number | The green value, from 0 to 255. |
blue |
Number | The blue value, from 0 to 255. |
Returns:
- Type
- HueColor
toCie() → {Array.<Number>}
Converts the color to a CIE color that Hue lamps are capable of showing. Note that the RGB-to-CIE conversion is
necessarily approximate.
Returns:
X, Y, and brightness components.
- Type
- Array.<Number>
toHex() → {String}
Converts the color to a CSS-style hex string. Note that the CIE-to-RGB conversion is necessarily approximate.
Returns:
- Type
- String
toHsb() → {Array.<Number>}
Converts the color to HSB.
Returns:
- Type
- Array.<Number>
toRgb() → {Array.<Number>}
Converts the color to RGB. Note that the CIE-to-RGB conversion is necessarily approximate.
Returns:
Red, green, and blue components.
- Type
- Array.<Number>