Math & data behind color spaces and color conversions.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test WIP updating test cases. Mar 4, 2018
.eslintrc.json Eslint and deps Nov 22, 2016
.gitignore Add gitignore Feb 1, 2016
.travis.yml chore(travis): update node_js version Jan 5, 2017
LICENSE Actualize readme Jun 3, 2015
README.md Fix badge color Mar 5, 2018
ciecam.js Eslint and deps Nov 22, 2016
cmy.js Eslint and deps Nov 22, 2016
cmyk.js Eslint and deps Nov 22, 2016
coloroid.js Eslint and deps Nov 22, 2016
cubehelix.js Eslint and deps Nov 22, 2016
hcg.js Eslint and deps Nov 22, 2016
hcy.js Eslint and deps Nov 22, 2016
hpluv.js renaming. husl.js -> hsluv.js, huslp.js -> hpluv.js Mar 4, 2018
hsi.js Eslint and deps Nov 22, 2016
hsl.js Eslint and deps Nov 22, 2016
hsluv.js renaming. husl.js -> hsluv.js, huslp.js -> hpluv.js Mar 4, 2018
hsp.js Added hsp support Aug 1, 2017
hsv.js Eslint and deps Nov 22, 2016
hwb.js Eslint and deps Nov 22, 2016
index.js typo in index.js Mar 4, 2018
jpeg.js Eslint and deps Nov 22, 2016
lab.js Eslint and deps Nov 22, 2016
labh.js Eslint and deps Nov 22, 2016
lchab.js Eslint and deps Nov 22, 2016
lchuv.js Eslint and deps Nov 22, 2016
lms.js Eslint and deps Nov 22, 2016
luv.js Eslint and deps Nov 22, 2016
munsell.js Eslint and deps Nov 22, 2016
osaucs.js Eslint and deps Nov 22, 2016
package.json 1.16.0 Mar 5, 2018
rgb.js Eslint and deps Nov 22, 2016
tsl.js Eslint and deps Nov 22, 2016
ucs.js Eslint and deps Nov 22, 2016
uvw.js Eslint and deps Nov 22, 2016
xvycc.js Eslint and deps Nov 22, 2016
xyy.js Eslint and deps Nov 22, 2016
xyz.js Eslint and deps Nov 22, 2016
ycbcr.js Eslint and deps Nov 22, 2016
yccbccrc.js Eslint and deps Nov 22, 2016
ycgco.js Eslint and deps Nov 22, 2016
ydbdr.js Eslint and deps Nov 22, 2016
yes.js Eslint and deps Nov 22, 2016
yiq.js Eslint and deps Nov 22, 2016
ypbpr.js Eslint and deps Nov 22, 2016
yuv.js Eslint and deps Nov 22, 2016

README.md

Color-space Build Status stable OpenCollective OpenCollective

Conversions and data for color spaces. Demo.

Usage

npm install color-space

var space = require('color-space');

//convert lab to lch
var result = space.lab.lch([80,50,60]);

You can require a separate space to reduce size significantly:

var rgb = require('color-space/rgb');
var hsl = require('color-space/hsl');

//convert rgb to hsl
rgb.hsl([200,230,100]);

API

<fromSpace>.<toSpace>(array);
<space>.name //space name
<space>.min //channel minimums
<space>.max //channel maximums
<space>.channel //channel names
<space>.alias //alias space names

Spaces

Contribute

Please fork, add color space with basic conversions to/from XYZ or RGB and tests. The goal of project is to provide the most complete set of color spaces with maximally minimal uniform API.

Credits

Thanks to all the color scientists, who devoted their lives to color research and delivered their knowledge to us, for now we can trust them and use their formulas and their code.

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

Related

  • colormap — collection of colormaps to map colors of images/data. A replacement for visualising spaces like cubehelix.
  • color-spectrum — convert spectrum to a color.
  • color-interpolate — interpolate between color values.
  • color-tool — color picker based on color-space.

Similar projects