{"_id":"color-blind","_rev":"3332339","name":"color-blind","description":"Simulate color blindness by converting RGB hex codes","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"skratchdot","email":""}],"time":{"modified":"2024-07-10T07:28:13.000Z","created":"2014-06-21T23:40:05.943Z","0.1.3":"2022-10-13T12:43:27.025Z","0.1.2":"2022-10-13T12:41:26.166Z","0.1.1":"2015-08-19T14:18:48.192Z","0.1.0":"2014-06-21T23:40:05.943Z"},"users":{},"author":{"name":"skratchdot","email":"git@skratchdot.com"},"repository":{"type":"git","url":"git://github.com/skratchdot/color-blind.git"},"versions":{"0.1.3":{"name":"color-blind","description":"Simulate color blindness by converting RGB hex codes","version":"0.1.3","homepage":"https://github.com/skratchdot/color-blind","author":{"name":"skratchdot","email":"git@skratchdot.com"},"repository":{"type":"git","url":"git://github.com/skratchdot/color-blind.git"},"bugs":{"url":"https://github.com/skratchdot/color-blind/issues"},"licenses":[{"type":"MIT","url":"https://spdx.org/licenses/MIT.html"},{"type":"CC-BY-SA-4.0","url":"https://spdx.org/licenses/CC-BY-SA-4.0.html"}],"main":"lib/color-blind","engines":{"node":">= 14"},"scripts":{"test":"gulp test"},"dependencies":{"onecolor":"^3.1.0"},"devDependencies":{"gulp":"^4.0.2","gulp-jshint":"^2.1.0","gulp-nodeunit":"^0.1.0"},"keywords":["color","colour","blindness","simulation","rgb","protanomaly","protanopia","deuteranomaly","deuteranopia","tritanomaly","tritanopia","achromatomaly","achromatopsia"],"gitHead":"99cf696821a67d2f5ec327a7a7559e913dd62c04","_id":"color-blind@0.1.3","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"shasum":"81630ed79ea1536207cadbab0205c4f670eef7bf","size":12131,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-blind/download/color-blind-0.1.3.tgz"},"_npmUser":{"name":"skratchdot","email":"git@skratchdot.com"},"directories":{},"maintainers":[{"name":"skratchdot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/color-blind_0.1.3_1665665006817_0.4278551002207698"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-22T01:32:05.167Z","publish_time":1665665007025,"_cnpm_publish_time":1665665007025},"0.1.2":{"name":"color-blind","description":"Simulate color blindness by converting RGB hex codes","version":"0.1.2","homepage":"https://github.com/skratchdot/color-blind","author":{"name":"skratchdot","email":"git@skratchdot.com"},"repository":{"type":"git","url":"git://github.com/skratchdot/color-blind.git"},"bugs":{"url":"https://github.com/skratchdot/color-blind/issues"},"licenses":[{"type":"MIT","url":"https://spdx.org/licenses/MIT.html"},{"type":"CC-BY-SA-4.","":"https://spdx.org/licenses/CC-BY-SA-4.0.html"}],"main":"lib/color-blind","engines":{"node":">= 14"},"scripts":{"test":"gulp test"},"dependencies":{"onecolor":"^3.1.0"},"devDependencies":{"gulp":"^4.0.2","gulp-jshint":"^2.1.0","gulp-nodeunit":"^0.1.0"},"keywords":["color","colour","blindness","simulation","rgb","protanomaly","protanopia","deuteranomaly","deuteranopia","tritanomaly","tritanopia","achromatomaly","achromatopsia"],"gitHead":"7405fda3199584e10c27d88da1ea2dc8f304195c","_id":"color-blind@0.1.2","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"shasum":"feccb78bc4b7801b907a222cb16a83e45a8a81f0","size":12133,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-blind/download/color-blind-0.1.2.tgz"},"_npmUser":{"name":"skratchdot","email":"git@skratchdot.com"},"directories":{},"maintainers":[{"name":"skratchdot","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/color-blind_0.1.2_1665664885930_0.40563905902440767"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-22T01:32:03.813Z","publish_time":1665664886166,"_cnpm_publish_time":1665664886166},"0.1.1":{"name":"color-blind","description":"Simulate color blindness by converting RGB hex codes","version":"0.1.1","homepage":"https://github.com/skratchdot/color-blind","author":{"name":"skratchdot","email":"git@skratchdot.com"},"repository":{"type":"git","url":"git://github.com/skratchdot/color-blind.git"},"bugs":{"url":"https://github.com/skratchdot/color-blind/issues"},"licenses":[{"type":"MIT","url":"https://github.com/skratchdot/color-blind/blob/master/LICENSE-MIT"}],"main":"lib/color-blind","engines":{"node":">= 0.8.0"},"scripts":{"test":"gulp test"},"dependencies":{"onecolor":"^2.5.0"},"devDependencies":{"gulp":"^3.9.0","gulp-jshint":"^1.11.2","gulp-nodeunit":"0.0.5"},"keywords":["color","colour","blindness","simulation","rgb","protanomaly","protanopia","deuteranomaly","deuteranopia","tritanomaly","tritanopia","achromatomaly","achromatopsia"],"gitHead":"20dd5e8a6e615a88b1b0c91633e6ebd31c13b91d","_id":"color-blind@0.1.1","_shasum":"d6cf97b635fb6605c9dcc48efb58d5eb972a371e","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"skratchdot","email":"git@skratchdot.com"},"maintainers":[{"name":"skratchdot","email":""}],"dist":{"shasum":"d6cf97b635fb6605c9dcc48efb58d5eb972a371e","size":6460,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-blind/download/color-blind-0.1.1.tgz"},"directories":{},"_cnpmcore_publish_time":"2021-12-19T14:02:18.503Z","publish_time":1439993928192,"_cnpm_publish_time":1439993928192},"0.1.0":{"name":"color-blind","description":"Simulate color blindness by converting RGB hex codes","version":"0.1.0","homepage":"https://github.com/skratchdot/color-blind","author":{"name":"skratchdot","email":"git@skratchdot.com"},"repository":{"type":"git","url":"git://github.com/skratchdot/color-blind.git"},"bugs":{"url":"https://github.com/skratchdot/color-blind/issues"},"licenses":[{"type":"MIT","url":"https://github.com/skratchdot/color-blind/blob/master/LICENSE-MIT"}],"main":"lib/color-blind","engines":{"node":">= 0.8.0"},"scripts":{"test":"gulp test"},"dependencies":{"onecolor":"^2.4.0"},"devDependencies":{"gulp":"^3.8.1","gulp-jshint":"^1.6.3","gulp-nodeunit":"0.0.5"},"keywords":["color","colour","blindness","simulation","rgb","protanomaly","protanopia","deuteranomaly","deuteranopia","tritanomaly","tritanopia","achromatomaly","achromatopsia"],"gitHead":"d56d6e62676a17871f68cd6353a5b66658b3e3e8","_id":"color-blind@0.1.0","_shasum":"e2cc2c54aed0871307a254c5d239495843a3b6a1","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"skratchdot","email":"git@skratchdot.com"},"maintainers":[{"name":"skratchdot","email":""}],"dist":{"shasum":"e2cc2c54aed0871307a254c5d239495843a3b6a1","size":6446,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/color-blind/download/color-blind-0.1.0.tgz"},"directories":{},"_cnpmcore_publish_time":"2021-12-19T14:02:17.569Z","publish_time":1403394005943,"_cnpm_publish_time":1403394005943}},"readme":"# color-blind\n\n[![NPM version](https://badge.fury.io/js/color-blind.svg)](http://badge.fury.io/js/color-blind)\n[![Build Status](https://travis-ci.org/skratchdot/color-blind.png?branch=master)](https://travis-ci.org/skratchdot/color-blind)\n[![Code Climate](https://codeclimate.com/github/skratchdot/color-blind.png)](https://codeclimate.com/github/skratchdot/color-blind)\n[![Coverage Status](https://coveralls.io/repos/skratchdot/color-blind/badge.png)](https://coveralls.io/r/skratchdot/color-blind)\n[![Dependency Status](https://david-dm.org/skratchdot/color-blind.svg)](https://david-dm.org/skratchdot/color-blind)\n[![devDependency Status](https://david-dm.org/skratchdot/color-blind/dev-status.svg)](https://david-dm.org/skratchdot/color-blind#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/color-blind.png)](https://npmjs.org/package/color-blind)\n\n\n## Description\n\nSimulate color blindness by converting RGB hex codes.  This is a node.js port\nof the daltonize code by [mudcu.be](http://mudcu.be/).\nSee [Links](https://github.com/skratchdot/color-blind#links) for more information.\n\n\n## Getting Started\n\nInstall the module with: `npm install color-blind`\n\n```javascript\nvar blinder = require('color-blind');\nblinder.protanopia('#42dead'); // result: \"#d1c4a0\"\n```\n\n\n## Color Blindness Table\n\n|                    Group                           |                                    |                             |                          |\n|----------------------------------------------------|------------------------------------|-----------------------------|--------------------------|\n| **Trichromat**<br/>*3 good cones*                  |Normal                              |                             |                          |\n| **Anomalous Trichromat**<br/>*2 good cones, 1 bad* |Protanomaly<br/>*low red*           |Deuteranomaly<br/>*low green*|Tritanomaly<br/>*low blue*|\n| **Dichromat**<br/>*2 good cones, 1 blind*          |Protanopia<br/>*no red*             |Deuteranopia<br/>*no green*  |Tritanopia <br/>*no blue* |\n| **Monochromat**<br/>*1 good cone, 2 blind/bad*     |Achromatomaly<br />*almost no color*|Achromatopsia<br/>*no color* |                          |\n\n\n## Documentation\n\nAll the exported functions accept 2 parameters:\n\n- **colorString** - any valid CSS color string\n- **returnRgb** *optional*\n  - if true, then an object containing RGB values is returned\n  - if false or not passed, then a hex string is returned\n\n\n#### blinder.protanomaly(colorString, returnRgb)\n\nPart of the \"Anomalous Trichromat\" family of color blindness. The viewer sees low amounts of red.\n\nExamples:\n```javascript\nblinder.protanomaly(\"#42dead\");\n// result: \"#9dcea5\"\nblinder.protanomaly(\"#42dead\", false);\n// result: \"#9dcea5\"\nblinder.protanomaly(\"#42dead\", true);\n// result: {\"R\":156.81027381701807,\"G\":205.52274401697787,\"B\":164.8656701007824}\n```\n\n#### blinder.protanopia(colorString, returnRgb)\n\nPart of the \"Dichromat\" family of color blindness. The viewer sees no red.\n\nExamples:\n```javascript\nblinder.protanopia(\"#42dead\");\n// result: \"#d1c4a0\"\nblinder.protanopia(\"#42dead\", false);\n// result: \"#d1c4a0\"\nblinder.protanopia(\"#42dead\", true);\n// result: {\"R\":208.70185885531413,\"G\":196.10716916953663,\"B\":160.21748158694382}\n```\n\n#### blinder.deuteranomaly(colorString, returnRgb)\n\nPart of the \"Anomalous Trichromat\" family of color blindness. The viewer sees low amounts of green.\n\nExamples:\n```javascript\nblinder.deuteranomaly(\"#42dead\");\n// result: \"#a5c9b3\"\nblinder.deuteranomaly(\"#42dead\", false);\n// result: \"#a5c9b3\"\nblinder.deuteranomaly(\"#42dead\", true);\n// result: {\"R\":165.29136650372695,\"G\":201.41446893677266,\"B\":178.9125102904318}\n```\n\n#### blinder.deuteranopia(colorString, returnRgb)\n\nPart of the \"Dichromat\" family of color blindness. The viewer sees no green.\n\nExamples:\n```javascript\nblinder.deuteranopia(\"#42dead\");\n// result: \"#debeb6\"\nblinder.deuteranopia(\"#42dead\", false);\n// result: \"#debeb6\"\nblinder.deuteranopia(\"#42dead\", true);\n// result: {\"R\":222.02929022014237,\"G\":189.6513083292142,\"B\":182.29108759925}\n```\n\n#### blinder.tritanomaly(colorString, returnRgb)\n\nPart of the \"Anomalous Trichromat\" family of color blindness. The viewer sees low amounts of blue.\n\nExamples:\n```javascript\nblinder.tritanomaly(\"#42dead\");\n// result: \"#56d8d1\"\nblinder.tritanomaly(\"#42dead\", false);\n// result: \"#56d8d1\"\nblinder.tritanomaly(\"#42dead\", true);\n// result: {\"R\":86.14054005420464,\"G\":216.21898840123637,\"B\":209.23279525212993}\n```\n\n#### blinder.tritanopia(colorString, returnRgb)\n\nPart of the \"Dichromat\" family of color blindness. The viewer sees no blue.\n\nExamples:\n```javascript\nblinder.tritanopia(\"#42dead\");\n// result: \"#62d5e6\"\nblinder.tritanopia(\"#42dead\", false);\n// result: \"#62d5e6\"\nblinder.tritanopia(\"#42dead\", true);\n// result: {\"R\":97.64942008517872,\"G\":212.91555320194286,\"B\":229.93724968191844}\n```\n\n#### blinder.achromatomaly(colorString, returnRgb)\n\nPart of the \"Monochromat\" family of color blindness. The viewer sees the absence of most color.\n\nExamples:\n```javascript\nblinder.achromatomaly(\"#42dead\");\n// result: \"#8ec7b5\"\nblinder.achromatomaly(\"#42dead\", false);\n// result: \"#8ec7b5\"\nblinder.achromatomaly(\"#42dead\", true);\n// result: {\"R\":141.91089545454545,\"G\":198.63816818181814,\"B\":180.81998636363636}\n```\n\n#### blinder.achromatopsia(colorString, returnRgb)\n\nPart of the \"Monochromat\" family of color blindness. The viewer sees no color at all.\n\nExamples:\n```javascript\nblinder.achromatopsia(\"#42dead\");\n// result: \"#b9b9b9\"\nblinder.achromatopsia(\"#42dead\", false);\n// result: \"#b9b9b9\"\nblinder.achromatopsia(\"#42dead\", true);\n// result: {\"R\":185.28855,\"G\":185.28855,\"B\":185.28855}\n```\n\n\n## Links\n\n- [Original Source](http://mudcu.be/sphere/js/Color.Blind.js)\n- [Color Blind / Daltonize Bookmarklet](http://daltonize.appspot.com/)\n- [Color Blind Bookmarklet](https://github.com/duhseekoh/Color-Blind)\n\n\n## Release History\n\n#### v0.1.0 - Released June 21, 2014\n\n- initial release\n\n\n## License\n\nOriginally this project was licensed with:\n\n```\nCopyright (c) 2014 skratchdot\nLicensed under the MIT license.\n```\n\nBut the main algorithm is from code that included:\n\n```\nThe Color Blindness Simulation function is\ncopyright (c) 2000-2001 by Matthew Wickline and the\nHuman-Computer Interaction Resource Network ( http://hcirn.com/ ).\n\nIt is used with the permission of Matthew Wickline and HCIRN,\nand is freely available for non-commercial use. For commercial use, please\ncontact the Human-Computer Interaction Resource Network ( http://hcirn.com/ ).\n```\n\nI've included a note about HCIRN that was copied/edited from http://colorlab.wickline.org/colorblind/colorlab/engine.js:\n\n```\nHCIRN appears to no longer exist. This makes it impractical\nfor users to obtain permission from HCIRN in order to use\nthis file for commercial works. Instead:\n\nThis work is licensed under a\nCreative Commons Attribution-ShareAlike 4.0 International License.\nhttp://creativecommons.org/licenses/by-sa/4.0/\n```\n\nOn 10/13/2022 the license needed to be updated to include `CC-BY-SA-4.0`.\n\nFor more information about this change, please see:\nhttps://github.com/skratchdot/color-blind/issues/3\n\nSorry for any issues this has caused.\n","_attachments":{},"homepage":"https://github.com/skratchdot/color-blind","bugs":{"url":"https://github.com/skratchdot/color-blind/issues"}}