@hexorialstudio/color-blinder
v1.0.3
Published
Color Blinder Simulate color blindness of the given valid color hex code
Downloads
520
Maintainers
Readme
Color Blinder
Color Blinder is the Color Blinder Functions to convert the any valid color hex to a color blindness hex color.
Getting Started
Install the module with: npm install @hexorialstudio/color-blinder
Documentation
const blinder = require('@hexorialstudio/color-blinder');
All the blinder functions accept 1 parameter:
- ColorHexString - any valid color hex string
blinder.protanomaly(hexCode)
Part of the "Anomalous Trichromat" family of color blindness. The viewer sees low amounts of red.
blinder.protanomaly("#ff00f7");
// result: "#9058fc"
blinder.protanopia(hexCode)
Part of the "Dichromat" family of color blindness. The viewer sees no red.
blinder.protanopia("#ff00f7");
// result: "#518bff"
blinder.deuteranomaly(hexCode)
Part of the "Anomalous Trichromat" family of color blindness. The viewer sees low amounts of green.
blinder.deuteranomaly("#ff00f7");
// result: "#9c5ae6"
blinder.deuteranopia(hexCode)
Part of the "Dichromat" family of color blindness. The viewer sees no green.
blinder.deuteranopia("#ff00f7");
// result: "#638edd"
blinder.tritanomaly(hexCode)
Part of the "Anomalous Trichromat" family of color blindness. The viewer sees low amounts of blue.
blinder.tritanomaly("#ff00f7");
// result: "#f43e9c"
blinder.tritanopia(hexCode)
Part of the "Dichromat" family of color blindness. The viewer sees no blue.
blinder.tritanopia("#ff00f7");
// result: "#ee6168"
blinder.achromatomaly(hexCode)
Part of the "Monochromat" family of color blindness. The viewer sees the absence of most color.
blinder.achromatomaly("#ff00f7");
// result: "#8a2d87"
blinder.achromatopsia(hexCode)
Part of the "Monochromat" family of color blindness. The viewer sees no color at all.
blinder.achromatopsia("#ff00f7");
// result: "#484848"