{"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":{"integrity":"sha512-RTFfpjrjClCCKFRxQxeltuoYqSgo2pIrK9NJYe+0I5KYR8Z7HGjObB1lo8P2mAuLJ7OfQUqIKKUKDstUdrNGRQ==","shasum":"feccb78bc4b7801b907a222cb16a83e45a8a81f0","tarball":"http://registry-npm.ywwl.com/color-blind/download/color-blind-0.1.2.tgz","fileCount":10,"unpackedSize":38702,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcArnottnuIv8pxtVAynFMo6/kRkD0N/MW8xzb9h42jgIgD1TV6A02RvNTT/uI+ngzSkb0HJyjGf2iHJig71o2oaU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSAd2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHcw/+O/s+85RUOkGprG+x+lSWL0Y9We0quniMY5SqicCrZCfvvxBF\r\nVzIucoA/GZYVz5abudYPjLvYM4306Ziiz/tYFnfqq5gozCgRLtitBkcRA9t1\r\n8VUvB/x3SmMKzM56NECJYGLblsQ0meihlK93/Qb1gTYa/oYUHJUgeCP3RRJ/\r\n9YxrIEfy93pkKnJZdxxEQdpz+rNbOhsYm88C7M5m+2Lmucpe07O6i6GIL80V\r\nuMD/2kaFa2TiVir04rEVbj74qKqP+sYQ2mtm8Sg7UCfyLxcejL6ZoQmyF745\r\nxuHqv1EBwerjtMihxkpgXmPyOeGw/fk7bl34QfeINfTMa8PpdlQZNXuHPGk7\r\n99Rjx52MZWEgy8yDBQN+ZmvgN0CJRddo7YRUXavVCbTzEC4aPKX3QFb9rGnX\r\n4oAIDYTYNMG+4NbpY7kQEsv8LF7HIwPCCfRF1X70s8BKxInSFVVio8xFMXUV\r\nPuTnPm6xto34juBqd5Y1uNYVOegbf0SSt9oTLNjdLJJvu3VTuxX24gmT+c5f\r\ncdZzNjYnL+HhChFxt1LxQR8WJlSX8uEPmbH4Ochcq8Fhi9+OxVIdYL689KXc\r\neLOQdKoi8Hrkb70ShdQOaPIdzY7Qu6+GwM92kIxbBJFZ5ylBObYhVxpq25vy\r\nHfs5s2ZitdyxrkLusVAShfoY9/IzlAE/Q90=\r\n=tOO6\r\n-----END PGP SIGNATURE-----\r\n","size":12133,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.2.tgz"},"_npmUser":{"name":"skratchdot","email":"git@skratchdot.com"},"directories":{},"maintainers":[{"name":"skratchdot","email":"git@skratchdot.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/color-blind_0.1.2_1665664885930_0.40563905902440767"},"_hasShrinkwrap":false,"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","publish_time":1665664886166,"_cnpm_publish_time":1665664886166,"dist-tags":{"latest":"0.1.3"}}