{"name":"chroma-js","version":"3.1.4","keywords":["color"],"author":{"name":"Gregor Aisch"},"license":"(BSD-3-Clause AND Apache-2.0)","_id":"chroma-js@3.1.4","maintainers":[{"name":"celtra-sysadmin","email":"npmjs-releases@celtra.com"},{"name":"dejancjs","email":"dejan+npmjs@celtra.com"},{"name":"celtra-devex","email":"devex@celtra.com"},{"name":"gka","email":"gregor@datawrapper.de"}],"homepage":"https://github.com/gka/chroma.js","bugs":{"url":"https://github.com/gka/chroma.js/issues"},"spm":{"main":"chroma.js","ignore":["src","doc","test"]},"dist":{"shasum":"76c41a29a57d8a5db69b6262d31d033b97238e8f","tarball":"http://registry-npm.ywwl.com/chroma-js/download/chroma-js-3.1.4.tgz","fileCount":119,"integrity":"sha512-PLUFupqtew/yJt2WuwMk5RSxcJToAxocYYS/afh899yCxbPQs7YXQ954lgpTi+bPuxSX8IWSIMsmZ+Zfk+DgGQ==","signatures":[{"sig":"MEQCIHvn+T7/SYZ5LMkaX3ubNCVr1Av2yGJZ6ZwdPCc2ehFZAiBYftP6rSRbJfwcgX0oOrl1QVis72YekxnECGFcd/NHfg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":395888,"size":105371,"noattachment":false,"key":"/chroma-js/-/chroma-js-3.1.4.tgz"},"main":"./index.js","type":"module","exports":{".":{"import":"./index.js","require":"./dist/chroma.cjs"},"./light":{"import":"./index-light.js","require":"./dist/chroma-light.cjs"},"./src/io/*.js":{"import":"./src/io/*.js"},"./src/ops/*.js":{"import":"./src/ops/*.js"},"./src/utils/*.js":{"import":"./src/utils/*.js"},"./src/colors/*.js":{"import":"./src/colors/*.js"},"./src/generator/*.js":{"import":"./src/generator/*.js"},"./src/interpolator/*.js":{"import":"./src/interpolator/*.js"}},"gitHead":"b35ee49456176b3edaa716df0cae83a4601fe2dc","scripts":{"docs":"cd docs && make","lint":"prettier --check index.js index.umd.js index.umd.light.js src *.config.js test && eslint index.js index.umd.js index.umd.light.js src","test":"vitest","build":"rollup -c && cross-env DEV=1 rollup -c ","format":"prettier --write index.js index.umd.js index.umd.light.js src *.config.js test","prepare":"husky","test:update":"vitest -u","docs-preview":"cd docs && make && make preview","prepublishOnly":"npm test -- --run && node .bin/update-version.cjs && npm run build"},"_npmUser":{"name":"gka","email":"gregor@datawrapper.de"},"repository":{"url":"git://github.com/gka/chroma.js.git","type":"git"},"_npmVersion":"10.9.2","description":"JavaScript library for color conversions","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.24.0","devDependencies":{"husky":"^9.1.7","eslint":"^9.39.1","rollup":"^4.53.3","vitest":"^4.0.14","globals":"^16.5.0","prettier":"^3.7.1","cross-env":"^10.1.0","minimatch":"^10.1.1","@eslint/js":"^9.39.1","http-server":"^14.1.1","@eslint/eslintrc":"^3.3.1","markdown-to-html":"0.0.13","@babel/eslint-parser":"^7.28.5","@rollup/plugin-buble":"^1.0.3","@rollup/plugin-terser":"^0.4.4","rollup-plugin-license":"^3.6.0"},"_npmOperationalInternal":{"tmp":"tmp/chroma-js_3.1.4_1764281555334_0.5520480252082334","host":"s3://npm-registry-packages-npm-production"},"readme":"# Chroma.js\n\n[Chroma.js](https://vis4.net/chromajs/) is a ~~tiny~~ [small-ish](https://bundlejs.com/?q=chroma-js) zero-dependency JavaScript library for all kinds of color conversions and color scales.\n\n[![Build Status](https://api.travis-ci.com/gka/chroma.js.svg?branch=master)](https://travis-ci.com/gka/chroma.js)\n[![Build size](https://deno.bundlejs.com/?q=chroma-js&badge)](https://bundlejs.com/?q=chroma-js)\n\n\n\n### Usage\n\nInstall from npm\n\n```\nnpm install chroma-js\n```\n\nImport package into project\n\n```javascript\nimport chroma from \"chroma-js\";\n```\n\nInitiate and manipulate colors:\n\n```javascript\nchroma('#D4F880').darken().hex();  // #a1c550\n```\n\nWorking with color scales is easy, too:\n\n```javascript\nscale = chroma.scale(['white', 'red']);\nscale(0.5).hex(); // #FF7F7F\n```\n\nLab/Lch interpolation looks better than RGB\n\n```javascript\nchroma.scale(['white', 'red']).mode('lab');\n```\n\nCustom domains! Quantiles! Color Brewer!!\n\n```javascript\nchroma.scale('RdYlBu').domain(myValues, 7, 'quantiles');\n```\n\nAnd why not use logarithmic color scales once in your life?\n\n```javascript\nchroma.scale(['lightyellow', 'navy']).domain([1, 100000], 7, 'log');\n```\n\n### Like it?\n\nWhy not dive into the [interactive documentation](http://gka.github.io/chroma.js/) (there's a [static version](https://github.com/gka/chroma.js/blob/master/docs/src/index.md), too). You can download [chroma.min.js](https://raw.github.com/gka/chroma.js/master/chroma.min.js) or use the [hosted version on unpkg.com](https://app.unpkg.com/chroma-js@latest/files/dist).\n\nYou can use it in node.js, too!\n\n    npm install chroma-js\n\nOr you can use it in SASS using [chromatic-sass](https://github.com/bugsnag/chromatic-sass)!\n\n### Want to contribute?\n\nCome over and say hi in our [Discord channel](https://discord.gg/7fgurEqTRe)!\n\n### Build instructions\n\nFirst clone the repository and install the dev dependencies:\n\n    git clone git@github.com:gka/chroma.js.git\n    cd chroma.js\n    npm install\n\nThen compile the coffee-script source files to the build files:\n\n    npm run build\n\nDon't forget to tests your changes! You will probably also want to add new test to the `/test` folder in case you added a feature.\n\n    npm test\n\nAnd to update the documentation just run\n\n    npm run docs\n\nTo preview the docs locally you can use\n\n    npm run docs-preview\n\n### Similar Libraries / Prior Art\n\n* [Chromatist](https://github.com/jrus/chromatist)\n* [GrapeFruit](https://github.com/xav/Grapefruit) (Python)\n* [colors.py](https://github.com/mattrobenolt/colors.py) (Python)\n* [d3.js](https://github.com/mbostock/d3)\n* [Color Art](https://github.com/JiatLn/color-art) (Rust)\n\n\n\n### Author\n\nChroma.js is written by [Gregor Aisch](http://driven-by-data.net).\n\n### License\n\nReleased under [BSD license](http://opensource.org/licenses/BSD-3-Clause).\nVersions prior to 0.4 were released under [GPL](http://www.gnu.org/licenses/gpl-3.0).\n\n### Further reading\n\n* [How To Avoid Equidistant HSV Colors](https://www.vis4.net/blog/avoid-equidistant-hsv-colors/)\n* [Mastering Multi-hued Color Scales with Chroma.js](https://www.vis4.net/blog/mastering-multi-hued-color-scales/)\n\n### FAQ\n\n**There have been no commits in X weeks. Is chroma.js dead?**\n\nNo! It's just that the author of this library has other things to do than devoting every week of his life to making cosmetic changes to a piece of software that is working just fine as it is, just so that people like you don't feel like it's abandoned and left alone in this world to die. Bugs will be fixed. Some new things will come at some point. Patience.\n\n**I want to help maintaining chroma.js!**\n\nYay, that's awesome! Please say hi at our [Discord chat](https://discord.gg/m2M7k5Nf) to get in touch\n","publish_time":1764281555531,"_cnpm_publish_time":1764281555531,"dist-tags":{"latest":"3.3.0"}}