Global

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.
Source:
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.
Source:
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
Source:
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.
Source:
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.
Source:
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.
Source:
Returns:
Type
String

toHsb() → {Array.<Number>}

Converts the color to HSB.
Source:
Returns:
Type
Array.<Number>

toRgb() → {Array.<Number>}

Converts the color to RGB. Note that the CIE-to-RGB conversion is necessarily approximate.
Source:
Returns:
Red, green, and blue components.
Type
Array.<Number>