{"name":"color-space","version":"2.3.0","keywords":["color","colour","rgb","hsl","hsv","lab","luv","lch","cie","hsluv","husl","color-convert","gamut","color-conversions","color-space","color-translation","color-data","coloroid","cubehelix","munsell","hcg","hsp"],"author":{"name":"Dmitry Ivanov","email":"df.creative@gmail.com"},"license":"MIT","_id":"color-space@2.3.0","homepage":"https://github.com/colorjs/color-space#readme","bugs":{"url":"https://github.com/colorjs/color-space/issues"},"dist":{"shasum":"05c4bf970e20447d1613016ceaab9a64036bbfc7","tarball":"http://registry-npm.ywwl.com/color-space/download/color-space-2.3.0.tgz","fileCount":87,"integrity":"sha512-S2N/Pp8SEWGPHMcpAHUHVrkeqb3pZgBrKV4MH5183u4DYIrJl9bqNvnBRSSkz9PCXjWshtuVP4/ddCTxEK9lXg==","signatures":[{"sig":"MEUCIQDelT/PCAOI/lSgKVE1/dpKdg/pg26OURo2abAVVAMNewIgJvuGJEMX0aCoHX766ahe3nXl0XwzsscGFkrzUgtVCRQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":188652,"size":55021,"noattachment":false,"key":"/color-space/-/color-space-2.3.0.tgz"},"main":"./index.js","type":"module","types":"./types/index.d.ts","gitHead":"c2fdec4cd0bdbee8b2fd66f5f251602ad25f7ce4","scripts":{"min":"esbuild ./dist/color-space.js --minify --outfile=dist/color-space.min.js","test":"uvu test","build":"esbuild ./index.js --bundle --format=esm --outfile=dist/color-space.js","prepublishOnly":"npm run build && npm run min"},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/colorjs/color-space.git","type":"git"},"_npmVersion":"10.9.2","description":"Collection of color space conversions","directories":{},"_nodeVersion":"23.5.0","typesVersions":{"*":{"cmy":["./types/cmy.d.ts"],"hcg":["./types/hcg.d.ts"],"hcy":["./types/hcy.d.ts"],"hsi":["./types/hsi.d.ts"],"hsl":["./types/hsl.d.ts"],"hsp":["./types/hsp.d.ts"],"hsv":["./types/hsv.d.ts"],"hwb":["./types/hwb.d.ts"],"lab":["./types/lab.d.ts"],"lms":["./types/lms.d.ts"],"luv":["./types/luv.d.ts"],"tsl":["./types/tsl.d.ts"],"ucs":["./types/ucs.d.ts"],"uvw":["./types/uvw.d.ts"],"xyy":["./types/xyy.d.ts"],"xyz":["./types/xyz.d.ts"],"yes":["./types/yes.d.ts"],"yiq":["./types/yiq.d.ts"],"yuv":["./types/yuv.d.ts"],"cmyk":["./types/cmyk.d.ts"],"jpeg":["./types/jpeg.d.ts"],"labh":["./types/labh.d.ts"],"hpluv":["./types/hpluv.d.ts"],"hsluv":["./types/hsluv.d.ts"],"lchab":["./types/lchab.d.ts"],"lchuv":["./types/lchuv.d.ts"],"xvycc":["./types/xvycc.d.ts"],"ycbcr":["./types/ycbcr.d.ts"],"ycgco":["./types/ycgco.d.ts"],"ydbdr":["./types/ydbdr.d.ts"],"ypbpr":["./types/ypbpr.d.ts"],"cmy.js":["./types/cmy.d.ts"],"hcg.js":["./types/hcg.d.ts"],"hcy.js":["./types/hcy.d.ts"],"hsi.js":["./types/hsi.d.ts"],"hsl.js":["./types/hsl.d.ts"],"hsp.js":["./types/hsp.d.ts"],"hsv.js":["./types/hsv.d.ts"],"hwb.js":["./types/hwb.d.ts"],"lab.js":["./types/lab.d.ts"],"lms.js":["./types/lms.d.ts"],"luv.js":["./types/luv.d.ts"],"osaucs":["./types/osaucs.d.ts"],"rgb.js":["./types/rgb.d.ts"],"tsl.js":["./types/tsl.d.ts"],"ucs.js":["./types/ucs.d.ts"],"uvw.js":["./types/uvw.d.ts"],"xyy.js":["./types/xyy.d.ts"],"xyz.js":["./types/xyz.d.ts"],"yes.js":["./types/yes.d.ts"],"yiq.js":["./types/yiq.d.ts"],"yuv.js":["./types/yuv.d.ts"],"cmyk.js":["./types/cmyk.d.ts"],"jpeg.js":["./types/jpeg.d.ts"],"labh.js":["./types/labh.d.ts"],"munsell":["./types/munsell.d.ts"],"coloroid":["./types/coloroid.d.ts"],"hpluv.js":["./types/hpluv.d.ts"],"hsluv.js":["./types/hsluv.d.ts"],"lchab.js":["./types/lchab.d.ts"],"lchuv.js":["./types/lchuv.d.ts"],"xvycc.js":["./types/xvycc.d.ts"],"ycbcr.js":["./types/ycbcr.d.ts"],"yccbccrc":["./types/yccbccrc.d.ts"],"ycgco.js":["./types/ycgco.d.ts"],"ydbdr.js":["./types/ydbdr.d.ts"],"ypbpr.js":["./types/ypbpr.d.ts"],"cubehelix":["./types/cubehelix.d.ts"],"osaucs.js":["./types/osaucs.d.ts"],"rgb.js.js":["./types/rgb.d.ts"],"munsell.js":["./types/munsell.d.ts"],"coloroid.js":["./types/coloroid.d.ts"],"yccbccrc.js":["./types/yccbccrc.d.ts"],"cubehelix.js":["./types/cubehelix.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"tst":"^8.0.1","esbuild":"^0.24.2"},"_npmOperationalInternal":{"tmp":"tmp/color-space_2.3.0_1738450135902_0.26002932719179594","host":"s3://npm-registry-packages-npm-production"},"readme":"# Color-space [![test](https://github.com/colorjs/color-space/actions/workflows/test.yml/badge.svg)](https://github.com/colorjs/color-space/actions/workflows/test.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges) [![npm](https://img.shields.io/npm/v/color-space)](https://npmjs.org/color-space) [![size](https://img.shields.io/bundlephobia/minzip/color-space/latest)](https://bundlephobia.com/package/color-space)\n\n<img src=\"https://raw.githubusercontent.com/colorjs/color-space/gh-pages/logo.png\" width=\"100%\" height=\"150\"/>\n\nOpen collection of color spaces.\n\n[Demo](http://colorjs.github.io/color-space).\n\n\n## Usage\n\n```js\nimport space from 'color-space';\n\n//convert lab to lch\nvar result = space.lab.lch([80,50,60]);\n```\n\nSpaces can be imported separately:\n\n```js\nimport rgb from 'color-space/rgb.js';\nimport hsl from 'color-space/hsl.js';\n\n//convert rgb to hsl\nrgb.hsl([200, 230, 100]);\n```\n<!--\nNew space can be registered as:\n```js\nimport space, {register} from 'color-space';\n\nregister(spaceDefiniton)\n``` -->\n\n## API\n\n```js\n<fromSpace>.<toSpace>(array);\n<space>.name //space name\n<space>.channel //channel names\n<space>.min //channel minimums\n<space>.max //channel maximums\n```\n\n## Spaces\n\n* [x] [RGB](https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_RGB_colour_space) — sRGB\n* [x] [LRGB](https://en.wikipedia.org/wiki/SRGB#Transfer_function_(\"gamma\")) – linear light sRGB\n* [x] [HSL](https://en.wikipedia.org/wiki/HSL_and_HSV) — cylindrical-coordinates sRGB\n* [x] [HSV, HSB](https://en.wikipedia.org/wiki/HSL_and_HSV)\n* [x] [HWB](http://dev.w3.org/csswg/css-color/#the-hwb-notation)\n* [x] [HSI](https://en.wikipedia.org/wiki/HSL_and_HSV) — used for computer vision due to better separation of shapes in an image, comparing to HSL/HSB.\n* [x] [CMYK](https://en.wikipedia.org/wiki/CMYK_color_model)\n* [x] [CMY](https://en.wikipedia.org/wiki/CMYK_color_model)\n* [x] [XYZ](http://en.wikipedia.org/wiki/CIE_1931_color_space)\n* [x] [XYY (YXY)](https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space)\n* [x] [LAB](http://en.wikipedia.org/wiki/Lab_color_space)\n* [x] [LCH<sub>ab</sub>](https://en.wikipedia.org/wiki/Lab_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC)\n* [x] [LUV](http://en.wikipedia.org/wiki/CIELUV)\n* [x] [LCH<sub>uv</sub>](http://en.wikipedia.org/wiki/CIELUV#Cylindrical_representation)\n* [x] [HSL<sub>uv</sub>](http://www.hsluv.org/)\n* [x] [HPL<sub>uv</sub>](http://www.hsluv.org/)\n* [x] [LAB<sub>H</sub>](http://en.wikipedia.org/wiki/Lab_color_space#Hunter_Lab)\n* [x] [YUV](https://en.wikipedia.org/?title=YUV)\n* [x] [YIQ](https://en.wikipedia.org/?title=YIQ)\n* [x] [YC<sub>g</sub>C<sub>o</sub>](https://en.wikipedia.org/wiki/YCgCo)\n* [x] [YD<sub>b</sub>D<sub>r</sub>](https://en.wikipedia.org/wiki/YDbDr)\n* [x] [YP<sub>b</sub>P<sub>r</sub>](https://en.wikipedia.org/wiki/YPbPr)\n* [x] [YC<sub>b</sub>C<sub>r</sub>](https://en.wikipedia.org/wiki/YCbCr)\n* [x] [Y<sub>c</sub>C<sub>bc</sub>C<sub>rc</sub>](https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.2020_conversion)\n* [x] [JPEG](https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion)\n* [x] [XvYCC](https://en.wikipedia.org/wiki/XvYCC)\n* [x] [UCS](https://en.wikipedia.org/wiki/CIE_1960_color_space)\n* [x] [UVW](https://en.wikipedia.org/wiki/CIE_1964_color_space)\n* [x] [OKLAB](https://bottosson.github.io/posts/oklab/)\n* [ ] [Munsell](https://en.wikipedia.org/wiki/Munsell_color_system)\n* [ ] [NCS](https://en.wikipedia.org/wiki/Natural_Color_System)\n* [ ] [PMS](https://en.wikipedia.org/wiki/Pantone)\n* [ ] [RAL](https://en.wikipedia.org/wiki/RAL_colour_standard)\n* [x] [TSL](https://en.wikipedia.org/wiki/TSL_color_space) – color space designed for face detection purpose.\n* [ ] [RG](https://en.wikipedia.org/wiki/RG_color_space)\n* [ ] [RGK](https://en.wikipedia.org/wiki/RG_color_space)\n* [x] [Coloroid](https://en.wikipedia.org/wiki/Coloroid) — color space for architects and visual constructors, Hungarian Standard MSZ 7300 since 2000.\n* [ ] [OSA-UCS](https://en.wikipedia.org/wiki/OSA-UCS) — accurately reprsenting uniform color differences, developed by the Optical Society of America’s Committee on Uniform Color Scales.\n* [ ] [HKS](https://en.wikipedia.org/wiki/HKS_(colour_system))\n* [x] [LMS](http://en.wikipedia.org/wiki/LMS_color_space) — represents sensitivity of the human eye to Long, Medium and Short wavelengths.\n* [x] [Cubehelix](https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/) — colormaps for data visualization.\n* [ ] [Gray](http://dev.w3.org/csswg/css-color/#grays)\n* [ ] [CIECAM02](https://en.wikipedia.org/wiki/CIECAM02)\n* [ ] [US Federal Standard 595](https://en.wikipedia.org/wiki/Federal_Standard_595)\n* [ ] [Toyo](http://mytoyocolor.com/)\n* [ ] [PhotoYCC](http://www5.informatik.tu-muenchen.de/lehre/vorlesungen/graphik/info/csc/COL_34.htm)\n* [x] [HCG](https://github.com/acterhd/hcg-legacy)\n* [ ] [HCL](http://www.chilliant.com/rgb2hsv.html)\n* [x] [HSP](http://alienryderflex.com/hsp.html)\n* [ ] [HCY](http://chilliant.blogspot.ca/2012/08/rgbhcy-in-hlsl.html)\n* [x] [YES](http://www.atlantis-press.com/php/download_paper.php?id=198) — computationally effective color space for face recognition.\n* [ ] [British Standard Colour](http://www.britishstandardcolour.com/)\n* [ ] [RG chromacity](https://en.wikipedia.org/wiki/Rg_chromaticity)\n* [ ] [CIE DSH](https://en.wikipedia.org/wiki/Rg_chromaticity)\n* [x] [HSM](http://seer.ufrgs.br/rita/article/viewFile/rita_v16_n2_p141/7428)\n\n\n## Purpose\n\nA complete collection of color spaces with minimal consistent and clean API, verified formulas and cases.\nWhile alternatives focus on digital color spaces, this project takes broader perspective, including historical / multidisciplinary spaces.\nA side effect is verifying and correcting papers.\n\n## Credits\n\nThanks to all who contribute to color science – researchers, scientists, color theorists, specifiers, implementors, developers, and users.\n\n## Similar\n\n[culori](https://github.com/Evercoder/culori), [colorjs.io](https://colorjs.io/docs/procedural), [color-api](https://github.com/LeaVerou/color-api), [texel/color](https://github.com/texel-org/color?tab=readme-ov-file),\n\n<!--\n## See also\n* [color-convert](https://github.com/harthur/color-convert)\n* [chromatist](https://github.com/jrus/chromatist)\n* [spectra](https://github.com/avp/spectra)\n* [colorspaces.js](https://github.com/boronine/colorspaces.js)\n-->\n\n<p align=\"center\"><a href=\"https://github.com/krsnzd/license/\">🕉</a></p>\n","publish_time":1738450136117,"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"jaspervdg","email":"th.v.d.gronde@hccnet.nl"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_cnpm_publish_time":1738450136117,"dist-tags":{"latest":"3.6.0","next":"3.5.0"}}