@grewer/color-space
v1.16.0
Published
Color space conversions and data
Downloads
42
Maintainers
Readme
fixed:
- rgb.yuv error
Color-space
Conversions and data for color spaces. Demo.
Usage
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
- [x] RGB — additive color model based on red, green and blue primary colors.
- [x] HSL — cylindrical-coordinates representation of RGB.
- [x] HSV, HSB
- [x] HWB
- [x] HSI — used for computer vision due to better separation of shapes in an image, comparing to HSL/HSB.
- [x] CMYK
- [x] CMY
- [x] XYZ
- [x] XYY (YXY)
- [x] LAB
- [x] LCHab
- [x] LUV
- [x] LCHuv
- [x] HSLuv
- [x] HPLuv
- [x] LABHunter
- [x] YUV
- [x] YIQ
- [x] YCgCo
- [x] YDbDr
- [x] YPbPr
- [x] YCbCr
- [x] YcCbcCrc
- [x] JPEG
- [x] XvYCC
- [x] UCS
- [x] UVW
- [ ] Munsell
- [ ] NCS
- [ ] PMS
- [ ] RAL
- [ ] TSL
- [ ] RG
- [ ] RGK
- [x] 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
- [x] LMS — represents sensitivity of the human eye to Long, Medium and Short wavelengths.
- [x] Cubehelix — colormaps for data visualization.
- [ ] Gray
- [ ] CIECAM02
- [ ] US Federal Standard 595
- [ ] Toyo
- [ ] PhotoYCC
- [x] HCG
- [ ] HCL
- [x] HSP
- [ ] HCY
- [x] YES — computationally effective color space for face recognition.
- [ ] British Standard Colour
- [ ] RG chromacity
- [ ] CIE DSH
- [ ] HSM
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.