{"_id":"color-diff","_rev":"132518","name":"color-diff","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"time":{"modified":"2021-06-03T11:13:48.000Z","created":"2013-06-17T08:22:47.348Z","1.2.0":"2020-03-22T14:21:30.096Z","1.1.0":"2017-05-15T17:11:39.046Z","1.0.0":"2016-02-20T09:03:27.612Z","0.1.7":"2015-02-20T16:44:27.091Z","0.1.6":"2015-01-29T16:50:57.459Z","0.1.5":"2014-09-20T08:57:15.339Z","0.1.4":"2014-08-27T05:53:43.305Z","0.1.3":"2013-12-10T11:06:24.147Z","0.1.2":"2013-09-26T02:31:38.719Z","0.1.1":"2013-06-17T16:11:02.438Z","0.1.0":"2013-06-17T08:22:47.348Z"},"users":{"zeke":true,"eterna2":true,"tg-z":true,"jessaustin":true,"danielbayley":true},"author":{"name":"markusn kael"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"versions":{"1.2.0":{"name":"color-diff","version":"1.2.0","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000","ciede2000"],"author":{"name":"markusn kael"},"license":"BSD-3-Clause","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~1.4.1","mocha":"~5.0.4","coveralls":"~3.0.0","istanbul":"~0.4.5"},"homepage":"https://github.com/markusn/color-diff#readme","_id":"color-diff@1.2.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"shasum":"01a7c806de47dbd5ae571da49e65489666c999a7","size":9800,"noattachment":false,"key":"/color-diff/-/color-diff-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-1.2.0.tgz"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"_npmUser":{"name":"markusn","email":"markus@botten.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/color-diff_1.2.0_1584886889979_0.8986665173556223"},"_hasShrinkwrap":false,"publish_time":1584886890096,"_cnpm_publish_time":1584886890096},"1.1.0":{"name":"color-diff","version":"1.1.0","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000","ciede2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~1.3.0","mocha":"~2.3.3","coveralls":"~2.11.4","istanbul":"~0.3.21"},"homepage":"https://github.com/markusn/color-diff#readme","_id":"color-diff@1.1.0","_shasum":"983ae7f936679e94e365dfe44a16aa153bdae88e","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"983ae7f936679e94e365dfe44a16aa153bdae88e","size":9433,"noattachment":false,"key":"/color-diff/-/color-diff-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/color-diff-1.1.0.tgz_1494868297619_0.39374148729257286"},"directories":{},"publish_time":1494868299046,"_hasShrinkwrap":false,"_cnpm_publish_time":1494868299046},"1.0.0":{"name":"color-diff","version":"1.0.0","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000","ciede2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~1.3.0","mocha":"~2.3.3","coveralls":"~2.11.4","istanbul":"~0.3.21"},"homepage":"https://github.com/markusn/color-diff#readme","_id":"color-diff@1.0.0","_shasum":"9cf9218d8d33590b4d71dbc02df0c6f9acb207b4","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"9cf9218d8d33590b4d71dbc02df0c6f9acb207b4","size":8430,"noattachment":false,"key":"/color-diff/-/color-diff-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/color-diff-1.0.0.tgz_1455959002945_0.7541609853506088"},"directories":{},"publish_time":1455959007612,"_cnpm_publish_time":1455959007612,"_hasShrinkwrap":false},"0.1.7":{"name":"color-diff","version":"0.1.7","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~0.4.9","mocha":"~1.12.0","coveralls":"~2.1.0","istanbul":"~0.1.40"},"homepage":"https://github.com/markusn/color-diff","_id":"color-diff@0.1.7","_shasum":"6db78cd9482a8e459d40821eaf4b503283dcb8e2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"6db78cd9482a8e459d40821eaf4b503283dcb8e2","size":7618,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.7.tgz"},"directories":{},"publish_time":1424450667091,"_cnpm_publish_time":1424450667091,"_hasShrinkwrap":false},"0.1.6":{"name":"color-diff","version":"0.1.6","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~0.4.9","mocha":"~1.12.0","coveralls":"~2.1.0","istanbul":"~0.1.40"},"homepage":"https://github.com/markusn/color-diff","_id":"color-diff@0.1.6","_shasum":"74fe116175c18ab6ef109ee668d48a7f35cf181f","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"74fe116175c18ab6ef109ee668d48a7f35cf181f","size":7590,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.6.tgz"},"directories":{},"publish_time":1422550257459,"_cnpm_publish_time":1422550257459,"_hasShrinkwrap":false},"0.1.5":{"name":"color-diff","version":"0.1.5","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest or most different color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~0.4.9","mocha":"~1.12.0","coveralls":"~2.1.0","istanbul":"~0.1.40"},"_id":"color-diff@0.1.5","_shasum":"18e9e3de1287207479e1f9a9fb8bdb8c3bf7e52a","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"18e9e3de1287207479e1f9a9fb8bdb8c3bf7e52a","size":7620,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.5.tgz"},"directories":{},"publish_time":1411203435339,"_cnpm_publish_time":1411203435339,"_hasShrinkwrap":false},"0.1.4":{"name":"color-diff","version":"0.1.4","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~0.4.9","mocha":"~1.12.0","coveralls":"~2.1.0","istanbul":"~0.1.40"},"_id":"color-diff@0.1.4","_shasum":"5a90ace40538432ac836d17cdfbc063547220ce4","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"dist":{"shasum":"5a90ace40538432ac836d17cdfbc063547220ce4","size":7398,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.4.tgz"},"directories":{},"publish_time":1409118823305,"_cnpm_publish_time":1409118823305,"_hasShrinkwrap":false},"0.1.3":{"name":"color-diff","version":"0.1.3","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"istanbul cover _mocha && ((cat coverage/lcov.info | coveralls) || exit 0)"},"repository":{"type":"git","url":"git://github.com/markusn/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","readmeFilename":"README.md","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"devDependencies":{"assert":"~0.4.9","mocha":"~1.12.0","coveralls":"~2.1.0","istanbul":"~0.1.40"},"homepage":"https://github.com/markusn/color-diff","_id":"color-diff@0.1.3","dist":{"shasum":"eeb019f0b98df693a3d75e1b13c3547623a79a79","size":6224,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"markusn","email":"markus@botten.org"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"directories":{},"publish_time":1386673584147,"_cnpm_publish_time":1386673584147,"_hasShrinkwrap":false},"0.1.2":{"name":"color-diff","version":"0.1.2","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and LAB color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/kaelzhang/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert","conversion","CIEDE2000"],"author":{"name":"markusn kael"},"license":"BSD","readmeFilename":"README.md","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/kaelzhang/color-diff/issues"},"devDependencies":{"assert":"~0.4.9"},"_id":"color-diff@0.1.2","dist":{"shasum":"8fc0b23e6e10c933ae474e30b745a51351224b2b","size":5870,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"directories":{},"publish_time":1380162698719,"_cnpm_publish_time":1380162698719,"_hasShrinkwrap":false},"0.1.1":{"name":"color-diff","version":"0.1.1","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and lab color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/kaelzhang/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert"],"author":{"name":"markusn kael"},"license":"BSD","readmeFilename":"README","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/kaelzhang/color-diff/issues"},"devDependencies":{"assert":"~0.4.9"},"_id":"color-diff@0.1.1","dist":{"shasum":"af38125619fc30562449134c5e0b5adba2d3881a","size":5574,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.1.tgz"},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"directories":{},"publish_time":1371485462438,"_cnpm_publish_time":1371485462438,"_hasShrinkwrap":false},"0.1.0":{"name":"color-diff","version":"0.1.0","description":"Implemets the CIEDE2000 color difference algorithm, conversion between RGB and lab color and mapping all colors in palette X to the closest color in palette Y based on the CIEDE2000 difference.","main":"lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/kaelzhang/color-diff.git"},"keywords":["color","diff","color-diff","pallette","closest","convert"],"author":{"name":"markusn kael"},"license":"BSD","readmeFilename":"README","gitHead":"61269601ac72e65afd111565bfa68a2d13092de0","bugs":{"url":"https://github.com/kaelzhang/color-diff/issues"},"devDependencies":{"assert":"~0.4.9"},"_id":"color-diff@0.1.0","dist":{"shasum":"8fa8c5f2a68efab8533dc6d9d6a8a7fbd828be2c","size":5495,"noattachment":false,"key":"/color-diff/-/color-diff-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-diff/download/color-diff-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"kael","email":"i@kael.me"},"maintainers":[{"name":"markusn","email":"markus@botten.org"}],"directories":{},"publish_time":1371457367348,"_cnpm_publish_time":1371457367348,"_hasShrinkwrap":false}},"readme":"# Color-diff\n[![Build Status](https://travis-ci.org/markusn/color-diff.png)](https://travis-ci.org/markusn/color-diff)\n[![Coverage Status](https://coveralls.io/repos/markusn/color-diff/badge.png?branch=master)](https://coveralls.io/r/markusn/color-diff?branch=master)\n\nImplements the CIEDE2000 color difference algorithm, conversion between RGB and\nLAB color and mapping all colors in palette X to the closest color in palette Y\nbased on the CIEDE2000 difference.\n\n## Installation\n\n```bash\nnpm install color-diff --save\n```\n\n## Tests\n\nAre located in the `test/` folder and are run by:\n\n\tnpm test\n\n\n## Usage\n\n```js\nvar diff = require('color-diff');\n```\n\n### diff.closest(color, palette, bc)\n\nReturns the closest color. The parameter bc is optional and is used as\nbackground color when the color and/or palette uses alpha channels.\n\n```js\nvar color = { R: 255, G: 1, B: 30 };\n// red, green, blue\nvar palette = [ {R: 255, G: 0, B: 0 },\n                {R: 0, G: 255, B: 0 },\n                {R: 0, G: 0, B: 255} ];\n\ndiff.closest(color, palette); // {R: 255, G: 0, B: 0 }, red\n```\n\nThe result above is obvious, but `diff.closest` could deal with more complicated\ncases.\n\n### diff.furthest(color, palette, bc)\n\nReturns the most different color. The parameter bc is optional and is used as\nbackground color when the color and/or palette uses alpha channels.\n\n```js\nvar color = { R: 255, G: 255, B: 255 };\n// black, white\nvar palette = [ {R: 0, G: 0, B: 0 }, {R: 255, G: 255, B: 255 } ];\n\ndiff.furthest(color, palette); // {R: 0, G: 0, B: 0 }, black\n```\n\nThe result above is obvious, but `diff.furthest` could deal with more\ncomplicated cases.\n\n\n### diff.map_palette(palette1, palette2)\n\nReturns a mapping from the colors in palette1 to palette2.\n\n\n#### color\n`Object`\n\n`color` is an object containing 3 properties: 'R', 'G', 'B' (case insensitive), such as:\n\n```js\n{ R: 255, G: 1, B: 0 }\n```\n\nThere is an optional property 'A', which specifies the alpha channel between 0.0\nand 1.0.\n\nEach RGBA-color is transformed into a RGB-color before being used to calculate\nthe CIEDE2000 difference, using the specified background color\n(defaults to white).\n\n#### palette\n\n`Array.<Object>`\n\nColor palette array which contains many `color`-like objects.\n\n\n## Author\nMarkus Ekholm\n\n## License\n3-clause BSD. For details see `COPYING`.\n","_attachments":{},"homepage":"https://github.com/markusn/color-diff#readme","bugs":{"url":"https://github.com/markusn/color-diff/issues"},"license":"BSD-3-Clause"}