Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including color-space with all npm packages installed. Try it out:

var colorSpace = require("color-space")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

color-space v1.15.0

Color space conversions and data

Color-space Build Status stableOpenCollective OpenCollective

Conversions and data for color spaces. Demo.


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


<space>.name //space name
<space>.min //channel minimums
<space>.max //channel maximums
<space>.channel //channel names
<space>.alias //alias space names



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.


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.


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


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


  • 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


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free