{"id":13825488,"url":"https://github.com/skratchdot/color-blind","last_synced_at":"2025-10-28T22:14:41.372Z","repository":{"id":18038268,"uuid":"21081119","full_name":"skratchdot/color-blind","owner":"skratchdot","description":"Simulate color blindness by converting RGB hex codes.","archived":false,"fork":false,"pushed_at":"2022-10-13T12:43:20.000Z","size":145,"stargazers_count":106,"open_issues_count":4,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T11:49:49.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-CC-BY-SA-4.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-21T23:27:45.000Z","updated_at":"2025-03-23T23:56:29.000Z","dependencies_parsed_at":"2022-07-26T20:46:56.588Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/color-blind","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-blind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-blind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-blind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fcolor-blind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/color-blind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248668744,"owners_count":21142733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:21.995Z","updated_at":"2025-10-28T22:14:41.278Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"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**\u003cbr/\u003e*3 good cones*                  |Normal                              |                             |                          |\n| **Anomalous Trichromat**\u003cbr/\u003e*2 good cones, 1 bad* |Protanomaly\u003cbr/\u003e*low red*           |Deuteranomaly\u003cbr/\u003e*low green*|Tritanomaly\u003cbr/\u003e*low blue*|\n| **Dichromat**\u003cbr/\u003e*2 good cones, 1 blind*          |Protanopia\u003cbr/\u003e*no red*             |Deuteranopia\u003cbr/\u003e*no green*  |Tritanopia \u003cbr/\u003e*no blue* |\n| **Monochromat**\u003cbr/\u003e*1 good cone, 2 blind/bad*     |Achromatomaly\u003cbr /\u003e*almost no color*|Achromatopsia\u003cbr/\u003e*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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fcolor-blind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fcolor-blind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fcolor-blind/lists"}