Package Exports
- color-space
- color-space/cmyk
- color-space/cmyk.js
- color-space/cubehelix
- color-space/cubehelix.js
- color-space/hsl
- color-space/hsl.js
- color-space/hsv
- color-space/hsv.js
- color-space/hwb.js
- color-space/index.js
- color-space/lab
- color-space/lab.js
- color-space/lchab
- color-space/lchab.js
- color-space/lchuv.js
- color-space/rgb
- color-space/rgb.js
- color-space/xyy
- color-space/xyy.js
- color-space/xyz
- color-space/xyz.js
- color-space/yuv
- color-space/yuv.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-space) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Color-space


Collection of color spaces conversions & data.
Demo.
Usage
import space from 'color-space';
//convert lab to lch
var result = space.lab.lch([80,50,60]);
Spaces can be imported separately:
import rgb from 'color-space/rgb.js';
import hsl from 'color-space/hsl.js';
//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
- RGB — additive color model based on red, green and blue primary colors.
- HSL — cylindrical-coordinates representation of RGB.
- HSV, HSB
- HWB
- HSI — used for computer vision due to better separation of shapes in an image, comparing to HSL/HSB.
- CMYK
- CMY
- XYZ
- XYY (YXY)
- LAB
- LCHab
- LUV
- LCHuv
- HSLuv
- HPLuv
- LABHunter
- YUV
- YIQ
- YCgCo
- YDbDr
- YPbPr
- YCbCr
- YcCbcCrc
- JPEG
- XvYCC
- UCS
- UVW
- Munsell
- NCS
- PMS
- RAL
- TSL – color space designed for face detection purpose.
- RG
- RGK
- Coloroid — color space for architects and visual constructors, Hungarian Standard MSZ 7300 since 2000.
- OSA-UCS — accurately reprsenting uniform color differences, developed by the Optical Society of America’s Committee on Uniform Color Scales.
- HKS
- LMS — represents sensitivity of the human eye to Long, Medium and Short wavelengths.
- Cubehelix — colormaps for data visualization.
- Gray
- CIECAM02
- US Federal Standard 595
- Toyo
- PhotoYCC
- HCG
- HCL
- HSP
- HCY
- YES — computationally effective color space for face recognition.
- British Standard Colour
- RG chromacity
- CIE DSH
- HSM (fixed)
Contribute
Please fork, add color space with basic conversions to/from XYZ or RGB and tests. The goal of the project is the most complete set of color spaces with minimal uniform API.
Credits
Thanks to all scientists, who devoted their time to color research and conveyed their knowledge, for now we can use their formulas and code.
See also
- texel/color
- colorjs.io
- color-convert
- chromatist
- spectra
- colorspaces.js
- color-api - color API proposal by Lea Verou