Skip to content

jsfi/hue-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hue-color

Get the x and y coordinates of a color in CIE color space from rgb.

Install

This module requires node >=4.0.0

npm install --save hue-color

Usage

let xy = require('hue-color')(rgb, gamut);

Example

let xy = require('hue-color')(
    [0, 255, 0] //rgb
);

// xy = [0.1724161431490603, 0.7467966085220437]
/* with color gamut
 * gamut can be A, B, C or undefined
 * @see http://www.developers.meethue.com/documentation/supported-lights
 */
let xy = require('hue-color')(
    [0, 255, 0], //rgb
    'A'
);

// xy = [0.2151, 0.7106]

Next steps

Check accuracy of example values: http://www.developers.meethue.com/documentation/hue-xy-values

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published