Check color similarity in a color-blind safe way
npm install safe-dye#### Install with npm
```
npm install safe-dye
#### Usage
After requiring, use any of the available validation functions on a set of 2 colors in HEX, i.e #00A55A.true
The function will return if the colors are distinguishable or false otherwise.
`js
const SafeDye = require('safe-dye');
// Will return true if color1 and color2 are distinguishable for red-green type color blindness (Protanopia)
SafeDye.validateRedGreen(color1, color2);
// Will return true if color1 and color2 are distinguishable for blue-yellow type color blindness (Tritanopia)
SafeDye.validateBlueYellow(color1, color2);
// Will return true if both validateRedGreen and validateBlueYellow return true
SafeDye.validate(color1, color2);
// Will return true if color1 and color2 are distinguishable for normal color vision
SafeDye.validateNormal(color1, color2);
``
As a frontend developer, I sometimes find myself working on interfaces that allow users to customize color related options. As a simple example, consider choosing the color of text over a different background color for a blog post. While there are various tools out there to simulate color blind vision, we cannot expect our end users to use them when writing a colorful blog post :)
With this library, we can provide users with feedback and let them know that certain color combinations can be problematic for some audiences.
1. About the DeltaE algorithm
2. Designing Colorblind Friendly Websites