{"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":"git@skratchdot.com"}],"dist":{"shasum":"e2cc2c54aed0871307a254c5d239495843a3b6a1","tarball":"http://registry-npm.ywwl.com/color-blind/download/color-blind-0.1.0.tgz","integrity":"sha512-5F5tPTxD3XzXY0JoNwNKZV3GTwNPKwdo+n49Zr774K+8YvYq/sJv15Vo1XXE2lr4X7HHaNcUdaYWeL5fGeoatQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpDmDR5cw/jM3dP/SVP0p5xNACVRKjVWGEqatpIVJl3AiB7hcfoEupbpogZcWflTnlIjUUNO+jz+HX9MPGk+kGBWw=="}],"size":6446,"noattachment":false,"key":"/color-blind/-/color-blind-0.1.0.tgz"},"directories":{},"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":1403394005943,"_cnpm_publish_time":1403394005943,"dist-tags":{"latest":"0.1.3"}}