{"_id":"khroma","_rev":"4127084","name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2026-03-01T18:25:33.000Z","created":"2020-02-03T18:57:05.419Z","2.1.0":"2023-10-12T23:03:38.130Z","2.0.0":"2022-04-07T18:13:12.871Z","1.4.1":"2021-04-16T21:06:22.583Z","1.4.0":"2021-04-15T17:47:41.551Z","1.3.0":"2021-03-09T18:40:08.129Z","1.2.0":"2021-01-13T23:45:24.599Z","1.1.1":"2021-01-02T11:13:35.412Z","1.1.0":"2020-04-18T14:57:58.276Z","1.0.1":"2020-03-17T02:36:58.230Z","1.0.0":"2020-02-03T18:57:05.419Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"versions":{"2.1.0":{"name":"khroma","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"2.1.0","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.2.1","tsex":"^3.0.1","typescript":"^5.1.6"},"gitHead":"4968165afb0d3d09be66497e7985a34f7bfe6d42","bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@2.1.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"45f2ce94ce231a437cf5b63c2e886e6eb42bbbb1","size":32965,"noattachment":false,"key":"/khroma/-/khroma-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-2.1.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_2.1.0_1697151817819_0.8367902154884228"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-12T23:03:38.130Z","publish_time":1697151818130,"_source_registry_name":"default","_cnpm_publish_time":1697151818130},"2.0.0":{"name":"khroma","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"2.0.0","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"devDependencies":{"benchloop":"^1.3.2","fava":"^0.0.6","tsex":"^1.1.0","typescript":"^4.6.3"},"gitHead":"f998e9b67936dbe4d35e43cc0772717bd9ce8ea2","bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@2.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"shasum":"7577de98aed9f36c7a474c4d453d94c0d6c6588b","size":32365,"noattachment":false,"key":"/khroma/-/khroma-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-2.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_2.0.0_1649355192667_0.6891728553029257"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-07T18:27:38.570Z","publish_time":1649355192871,"_cnpm_publish_time":1649355192871},"1.4.1":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.4.1","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"3a6e209c662ffd62ec075e7d0b49a35668805464","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.4.1","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"ad6a5b6a972befc5112ce5129887a1a83af2c003","size":33398,"noattachment":false,"key":"/khroma/-/khroma-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.4.1.tgz"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.4.1_1618607182444_0.8879109188091145"},"_hasShrinkwrap":false,"publish_time":1618607182583,"_cnpm_publish_time":1618607182583,"_cnpmcore_publish_time":"2021-12-16T21:45:20.143Z"},"1.4.0":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.4.0","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"a93b404065a26a4e717b8def9c1f9f90d5bcb104","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.4.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"b69407254ac4839a8b94913d3039ed170cf0f16b","size":33350,"noattachment":false,"key":"/khroma/-/khroma-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.4.0.tgz"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.4.0_1618508861348_0.22273913613514584"},"_hasShrinkwrap":false,"publish_time":1618508861551,"_cnpm_publish_time":1618508861551,"_cnpmcore_publish_time":"2021-12-16T21:45:20.458Z"},"1.3.0":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.3.0","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"93a83a3224f62d49c9f1d5c4046fbf507fe72533","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.3.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"1a0238ffcce1b049b8c733d5b07850a379aca04a","size":32482,"noattachment":false,"key":"/khroma/-/khroma-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.3.0.tgz"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.3.0_1615315207948_0.40499546434727907"},"_hasShrinkwrap":false,"publish_time":1615315208129,"_cnpm_publish_time":1615315208129,"_cnpmcore_publish_time":"2021-12-16T21:45:21.125Z"},"1.2.0":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.2.0","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"1af7f05d9307516c70f562253f2e338d315d8db0","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"46dcc9d7533923c228b51724db108f11fec108d8","size":31695,"noattachment":false,"key":"/khroma/-/khroma-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.2.0.tgz"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.2.0_1610581524481_0.787653269981675"},"_hasShrinkwrap":false,"publish_time":1610581524599,"_cnpm_publish_time":1610581524599,"_cnpmcore_publish_time":"2021-12-16T21:45:21.340Z"},"1.1.1":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.1.1","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"38fcb0e0f6a7e776f07aaece7e3059f8138b5f12","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"de4cbd7581ed7ee0f85a4a7c9990ba62f729408c","size":31472,"noattachment":false,"key":"/khroma/-/khroma-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.1.1.tgz"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.1.1_1609586015217_0.8220401549497278"},"_hasShrinkwrap":false,"publish_time":1609586015412,"_cnpm_publish_time":1609586015412,"_cnpmcore_publish_time":"2021-12-16T21:45:21.654Z"},"1.1.0":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.1.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"3f0111183590eab8d258fb9e59e62c6baa38f1bb","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"cc17723eb719c5245ea66d23dd577d5695452db5","size":31464,"noattachment":false,"key":"/khroma/-/khroma-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.1.0.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.1.0_1587221878188_0.5809469686139415"},"_hasShrinkwrap":false,"publish_time":1587221878276,"_cnpm_publish_time":1587221878276,"_cnpmcore_publish_time":"2021-12-16T21:45:22.275Z"},"1.0.1":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.0.1","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"089d7f7c453fc182eff5a809815af7b55cca9adc","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"b682ea74cffe6947921c8e4ac3a797e3e12cf96c","size":31107,"noattachment":false,"key":"/khroma/-/khroma-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.0.1.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.0.1_1584412618069_0.3862649948494623"},"_hasShrinkwrap":false,"publish_time":1584412618230,"_cnpm_publish_time":1584412618230,"_cnpmcore_publish_time":"2021-12-16T21:45:22.717Z"},"1.0.0":{"name":"khroma","description":"A collection of functions for manipulating CSS colors, inspired by SASS.","version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"benchmark":"node tasks/benchmark.js","clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage","dev":"concurrently -i -n compile,test npm:compile:watch npm:test:watch"},"ava":{"files":["test/**/*.js"]},"bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/khroma.git"},"keywords":["sass","color","manipulation","manipulate","css","hex","rgb","hsl"],"dependencies":{},"devDependencies":{"@types/node":"^13.5.3","ava":"^2.4.0","ava-spec":"^1.1.1","benchloop":"^1.3.1","concurrently":"^5.1.0","nyc":"^15.0.0","rimraf":"^3.0.1","typescript":"^3.7.5","typescript-transform-export-interop":"^1.0.2"},"gitHead":"f8edab05ba59b4d6a3a7b9b5c88d8b554d02c8b9","homepage":"https://github.com/fabiospampinato/khroma#readme","_id":"khroma@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"5b1decf060e0e13e9417da6a4daa7a1d3f2612c8","size":31347,"noattachment":false,"key":"/khroma/-/khroma-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/khroma/download/khroma-1.0.0.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/khroma_1.0.0_1580756225303_0.4035620657785999"},"_hasShrinkwrap":false,"publish_time":1580756225419,"_cnpm_publish_time":1580756225419,"_cnpmcore_publish_time":"2021-12-16T21:45:23.035Z"}},"readme":"# [Khrôma](https://en.wiktionary.org/wiki/%CF%87%CF%81%E1%BF%B6%CE%BC%CE%B1)\n\nA collection of functions for manipulating CSS colors, inspired by SASS.\n\n## Features\n\n- **Small**: the entire library weighs ~5kb (min + gzip) and has no dependencies.\n- **Fast**: in our benchmark suite functions are executed at ~0.0025ms per call on a mid-2014 MBP.\n- **Flexible**: All valid CSS colors are supported.\n- **SASS-like**: if you're familiar with SASS you should feel right at home.\n\n## Install\n\n```sh\nnpm install --save khroma\n```\n\n## Usage\n\n```ts\nimport {red, isDark, darken, change} from 'khroma';\n\nred ( '#ffffff' ); // => 255\nisDark ( 'white' ); // => false\ndarken ( 'hsl(0, 5%, 100%)', 50 ); // => 'hsl(0, 5%, 50%)'\nchange ( 'rgb(255, 255, 255)', { a: 0.5 } ); // => 'rgba(255, 255, 255, 0.5)'\n```\n\n## Functions\n\nThese are all the provided functions, for each of them below you can find a short description, its interface and examples.\n\n| Create        | Convert                 | Get <sub>channel</sub>    | Get <sub>more</sub>             | Edit <sub>channel</sub>           | Edit <sub>more</sub> |\n| ------------- | ----------------------- | ------------------------- | ------------------------------- | --------------------------------- | -------------------- |\n| [hex](#hex)   | [toKeyword](#tokeyword) | [channel](#channel)       | [contrast](#contrast)           | [saturate](#saturate)             | [adjust](#adjust)    |\n| [rgb](#rgb)   | [toHex](#tohex)         | [red](#red)               | [luminance](#luminance)         | [desaturate](#desaturate)         | [change](#change)    |\n| [rgba](#rgba) | [toRgba](#torgba)       | [green](#green)           | [isDark](#isdark)               | [lighten](#lighten)               | [invert](#invert)    |\n| [hsl](#hsl)   | [toHsla](#tohsla)       | [blue](#blue)             | [isLight](#islight)             | [darken](#darken)                 | [mix](#mix)          |\n| [hsla](#hsla) |                         | [hue](#hue)               | [isTransparent](#istransparent) | [opacify](#opacify)               | [scale](#scale)      |\n|               |                         | [saturation](#saturation) | [isValid](#isvalid)             | [fadeIn](#fadein)                 |                      |\n|               |                         | [lightness](#lightness)   |                                 | [transparentize](#transparentize) |                      |\n|               |                         | [alpha](#alpha)           |                                 | [fadeOut](#fadeout)               |                      |\n|               |                         | [opacity](#opacity)       |                                 | [rgba](#rgba-alt) (alt)           |                      |\n|               |                         |                           |                                 | [complement](#complement)         |                      |\n|               |                         |                           |                                 | [grayscale](#grayscale)           |                      |\n\n### Create\n\nThese functions create a new color given the provided channels.\n\n#### `hex`\n\nAlias for [`rgba`](#rgba).\n\n#### `rgb`\n\nAlias for [`rgba`](#rgba).\n\n#### `rgba`\n\nCreates a new color given its rgba channels, the alpha channel is optional.\n\n```ts\nfunction rgba ( r: string, g: number, b: number, a: number = 1 ): string;\n```\n\n```ts\nrgba ( 255, 204, 0 ); // => '#ffcc00'\nrgba ( 255, 204, 0, 0.5 ); // => 'rgba(255, 204, 0, 0.5)'\n```\n\n#### `hsl`\n\nAlias for [`hsla`](#hsla).\n\n#### `hsla`\n\nCreates a new color given its hsla channels, the alpha channel is optional.\n\n```ts\nfunction hsla ( h: number, s: number, l: number, a: number = 1 ): string;\n```\n\n```ts\nhsla ( 0, 50, 100 ); // => 'hsl(0, 50%, 100%)'\nhsla ( 10, 50, 100, 0.5 ); // => 'hsla(10, 50%, 100%, 0.5)'\n```\n\n### Convert\n\nThese functions convert supported colors to a specific format.\n\n#### `toKeyword`\n\nConvert a color to the keyword format, when possible.\n\n```ts\nfunction toKeyword ( color: string ): string | undefined;\n```\n\n```ts\ntoKeyword ( '#ff0000' ); // => 'red'\ntoKeyword ( '#ffcc00' ); // => undefined\n```\n\n#### `toHex`\n\nConvert a color to the HEX format.\n\n```ts\nfunction toHex ( color: string ): string;\n```\n\n```ts\ntoHex ( 'red' ); // => '#ff0000'\ntoHex ( '#ff0000' ); // => '#ff0000'\n```\n\n#### `toRgba`\n\nConvert a color to the RGBA format.\n\n```ts\nfunction toRgba ( color: string ): string;\n```\n\n```ts\ntoRgba ( 'red' ); // => 'rgb(255, 0, 0)'\ntoRgba ( '#ff0000' ); // => 'rgb(255, 0, 0)'\ntoRgba ( '#00000088' ); // => 'rgba(0, 0, 0, 0.5333333333)'\n```\n\n#### `toHsla`\n\nConvert a color to the HSLA format.\n\n```ts\nfunction toHsla ( color: string ): string;\n```\n\n```ts\ntoHsla ( 'red' ); // => 'hsl(0, 100%, 50%)'\ntoHsla ( '#ff0000' ); // => 'hsl(0, 100%, 50%)'\ntoHsla ( 'rgb(255, 0, 0)' ); // => 'hsl(0, 100%, 50%)'\n```\n\n### Get <sub>channel</sub>\n\nThese functions get a single channel from the provided color.\n\n#### `channel`\n\nGets any single channel of the color.\n\n```ts\nfunction channel ( color: string, channel: 'r' | 'g' | 'b' | 'h' | 's' | 'l' | 'a' ): number;\n```\n\n```ts\nchannel ( '#ffcc00', 'r' ); // => 255\nchannel ( '#ffcc00', 'h' ); // => 48\nchannel ( '#ffcc00', 'a' ); // => 1\n```\n\n#### `red`\n\nGets the red channel of the color.\n\n```ts\nfunction red ( color: string ): number;\n```\n\n```ts\nred ( '#ffcc00' ); // => 255\n```\n\n#### `green`\n\nGets the green channel of the color.\n\n```ts\nfunction green ( color: string ): number;\n```\n\n```ts\ngreen ( '#ffcc00' ); // => 204\n```\n\n#### `blue`\n\nGets the blue channel of the color.\n\n```ts\nfunction blue ( color: string ): number;\n```\n\n```ts\nblue ( '#ffcc00' ); // => 0\n```\n\n#### `hue`\n\nGets the hue channel of the color.\n\n```ts\nfunction hue ( color: string ): number;\n```\n\n```ts\nhue ( 'hsl(0, 50%, 100%)' ); // => 0\n```\n\n#### `saturation`\n\nGets the saturation channel of the color.\n\n```ts\nfunction saturation ( color: string ): number;\n```\n\n```ts\nsaturation ( 'hsl(0, 50%, 100%)' ); // => 50\n```\n\n#### `lightness`\n\nGets the lightness channel of the color.\n\n```ts\nfunction lightness ( color: string ): number;\n```\n\n```ts\nlightness ( 'hsl(0, 50%, 100%)' ); // => 100\n```\n\n#### `alpha`\n\nGets the alpha channel of the color.\n\n```ts\nfunction alpha ( color: string ): number;\n```\n\n```ts\nalpha ( '#ffcc00' ); // => 1\nalpha ( 'rgba(255, 205, 0, 0.5)' ); // => 0.5\n```\n\n#### `opacity`\n\nAlias for [`alpha`](#alpha).\n\n### Get <sub>more</sub>\n\nThese functions get some other information from the provided color.\n\n#### `contrast`\n\nGets the contrast in luminance between two colors.\n\nContrast values go between 1 and 10. 1 means same color, >= 4 means decent contrast, >= 7 means great contrast, 10 means great contrast.\n\n```ts\nfunction contrast ( color1: string, color2: string ): number;\n```\n\n```ts\ncontrast ( '#000000', '#000000' ); // => 1\ncontrast ( '#000000', '#ffffff' ); // => 10\ncontrast ( '#888888', '#ffffff' ); // => 4.0617165366\n```\n\n#### `luminance`\n\nGets the [relative luminance](https://en.wikipedia.org/wiki/Relative_luminance) of the color.\n\n```ts\nfunction luminance ( color: string ): number;\n```\n\n```ts\nluminance ( 'black' ); // => 0\nluminance ( 'white' ); // => 1\nluminance ( '#ffcc00' ); // => 0.6444573127\n```\n\n#### `isDark`\n\nChecks if the provided color is a dark color.\n\n```ts\nfunction isDark ( color: string ): number;\n```\n\n```ts\nisDark ( 'black' ); // => true\nisDark ( 'white' ); // => false\nisDark ( '#ffcc00' ); // => false\n```\n\n#### `isLight`\n\nChecks if the provided color is a light color.\n\n```ts\nfunction isLight ( color: string ): number;\n```\n\n```ts\nisLight ( 'black' ); // => false\nisLight ( 'white' ); // => true\nisLight ( '#ffcc00' ); // => true\n```\n\n#### `isTransparent`\n\nChecks if the provided color is a transparent color.\n\n```ts\nfunction isTransparent ( color: string ): boolean;\n```\n\n```ts\nisTransparent ( 'transparent' ); // => true\nisTransparent ( '#ffcc0000' ); // => true\nisTransparent ( '#ffcc00' ); // => false\n```\n\n#### `isValid`\n\nChecks if the provided color is a valid color.\n\n```ts\nfunction isLight ( color: string ): boolean;\n```\n\n```ts\nisValid ( 'black' ); // => true\nisValid ( '#ffcc00' ); // => true\nisValid ( '#wtf' ); // => false\n```\n\n### Edit <sub>channel</sub>\n\nThese functions change a single channel of the provided color.\n\n#### `saturate`\n\nIncreases the saturation channel of the color.\n\n```ts\nfunction saturate ( color: string, amount: number ): string;\n```\n\n```ts\nsaturate ( 'hsl(0, 50%, 50%)', 25 ); // => 'hsl(0, 75%, 50%)'\n```\n\n#### `desaturate`\n\nDecreases the saturation channel of the color.\n\n```ts\nfunction desaturate ( color: string, amount: number ): string;\n```\n\n```ts\ndesaturate ( 'hsl(0, 50%, 50%)', 25 ); // => 'hsl(0, 25%, 50%)'\n```\n\n#### `lighten`\n\nIncreases the lightness channel of the color.\n\n```ts\nfunction lighten ( color: string, amount: number ): string;\n```\n\n```ts\nlighten ( 'hsl(0, 50%, 50%)', 25 ); // => 'hsl(0, 50%, 75%)'\n```\n\n#### `darken`\n\nDecreases the lightness channel of the color.\n\n```ts\nfunction darken ( color: string, amount: number ): string;\n```\n\n```ts\ndarken ( 'hsl(0, 50%, 50%)', 25 ); // => 'hsl(0, 50%, 25%)'\n```\n\n#### `opacify`\n\nIncreases the opacity channel of the color.\n\n```ts\nfunction opacify ( color: string, amount: number ): string;\n```\n\n```ts\nopacify ( 'rgba(255, 204, 0, 0.5)', 0.25 ); // => 'rgba(255, 204, 0, 0.75)'\n```\n\n#### `fadeIn`\n\nAlias for [`opacify`](#opacify).\n\n#### `transparentize`\n\nDecreases the opacity channel of the color.\n\n```ts\nfunction transparentize ( color: string, amount: number ): string;\n```\n\n```ts\ntransparentize ( 'rgba(255, 204, 0, 0.5)', 0.25 ); // => 'rgba(255, 204, 0, 0.25)'\n```\n\n#### `fadeOut`\n\nAlias for [`transparentize`](#transparentize).\n\n#### `rgba` (alt)\n\nSets a new value for the opacity channel.\n\n```ts\nfunction rgba ( color: string, amount: number ): string;\n```\n\n```ts\nrgba ( 'rgba(255, 204, 0, 0.5)', 0.1 ); // => 'rgba(255, 204, 0, 0.1)'\n```\n\n#### `complement`\n\nGets the complement of the color, rotating its hue channel by 180 degrees.\n\n```ts\nfunction complement ( color: string ): string;\n```\n\n```ts\ncomplement ( '#ffcc00' ); // => 'hsl(228, 100%, 50%)'\n```\n\n#### `grayscale`\n\nGets the grayscale version of the color, setting its saturation to 0.\n\n```ts\nfunction grayscale ( color: string ): string;\n```\n\n```ts\ngrayscale ( '#ffcc00' ); // => 'hsl(48, 0%, 50%)'\n```\n\n### Edit <sub>more</sub>\n\nThese functions can/will change more than a single channel at once of the provided color.\n\n#### `adjust`\n\nIncreases or decreases the value of any channel of the color.\n\n```ts\nfunction adjust ( color: string, channels: Record<'r' | 'g' | 'b' | 'h' | 's' | 'l' | 'a', number> ): string;\n```\n\n```ts\nadjust ( '#ffcc00', { r: -10, g: 200 } ); // => '#f5ff00'\nadjust ( '#ffcc00', { a: -0.5 } ); // => 'rgba(255, 204, 0, 0.5)'\nadjust ( '#ffcc00', { h: 50, l: -30 } ); // => 'hsl(98, 100%, 20%)'\n```\n\n#### `change`\n\nSets a new value for any channel of the color.\n\n```ts\nfunction change ( color: string, channels: Record<'r' | 'g' | 'b' | 'h' | 's' | 'l' | 'a', number> ): string;\n```\n\n```ts\nchange ( '#ffcc00', { r: 10, g: 200 } ); // => '#0ac800'\nchange ( '#ffcc00', { a: 0.5 } ); // => 'rgba(255, 204, 0, 0.5)'\nchange ( '#ffcc00', { h: 50, l: 30 } ); // => 'hsl(50, 100%, 30%)'\n```\n\n#### `invert`\n\nGets the inverse of the color.\n\n```ts\nfunction invert ( color: string, weight: number = 100 ): string;\n```\n\n```ts\ninvert ( '#ffcc00' ); // => '#0033ff'\ninvert ( '#ffcc00', 50 ); // => '#808080'\n```\n\n#### `mix`\n\nMixes two colors together.\n\n```ts\nfunction mix ( color1: string, color2: string, weight: number = 50 ): string;\n```\n\n```ts\nmix ( 'red', 'blue' ); // => '#800080'\nmix ( 'red', 'blue', 15 ); // => '#2600d9'\n```\n\n#### `scale`\n\nScales any channel of the color.\n\n```ts\nfunction scale ( color: string, channels: Record<'r' | 'g' | 'b' | 'h' | 's' | 'l' | 'a', number> ): string;\n```\n\n```ts\nscale ( '#ffcc00', { r: -50, b: 10 } ); // => '#80cc1a'\n```\n\n## License\n\nMIT © Fabio Spampinato, Andrew Maney\n","_attachments":{},"homepage":"https://github.com/fabiospampinato/khroma#readme","bugs":{"url":"https://github.com/fabiospampinato/khroma/issues"}}