Class: Util

Util()

new Util()

Utility class with several color and range conversion methods.

Methods

(static) convertHSVToCIE() → {CIE}

Method that converts colors from the HSV (or HSL) color space to the CIE (1931) color space (the latter is used by some ZigBee clusters).

Parameters:
Type Description
HSV

HSV color object

Returns:
  • CIE color space object
Type
CIE

(static) convertHSVToRGB() → {RGB}

Method that converts colors from the HSV (or HSL) color space to the RGB color space.

Parameters:
Type Description
HSV

HSV color object

Returns:
  • RGB color object
Type
RGB

(static) convertRGBToCIE() → {CIE|Error}

Method that converts colors from the RGB color space to the CIE (1931) color space (the latter is used by some ZigBee clusters).

Parameters:
Type Description
RGB

RGB color object

Returns:
  • CIE color space object
Type
CIE | Error

(static) convertRGBToHSV() → {HSV}

Method that converts colors from the RGB color space to the HSV color space.

Parameters:
Type Description
RGB

RGB color object

Returns:
  • HSV color object
Type
HSV

(static) mapValueRange(inputStart, inputEnd, outputStart, outputEnd, input) → {number}

Map a range of values to a different range of values.

Parameters:
Name Type Description
inputStart
inputEnd
outputStart
outputEnd
input
Returns:
Type
number