daltonize
v1.0.2
Published
๐ Shift RGB values into colorblind-safe colors with ease! ๐จ
Downloads
39
Readme
Daltonize
๐ Shift RGB values into colorblind-safe colors with ease! ๐จ
About
Daltonize is a library that helps designers and developers create colorblind-friendly designs. It provides a simple method to convert RGB values into colorblind-safe alternatives, ensuring better accessibility for individuals with color vision deficiencies.
Installation
You can install Daltonize via npm:
npm install daltonize
Usage
To use Daltonize, simply call the daltonize
method and provide an array of three components (R, G, and B) representing the original color. The method will return a safer RGB value for use:
const { daltonize } = require("daltonize");
const originalColor = [255, 0, 0]; // Red color
const colorblindSafeColorProtan = daltonize(originalColor, "protanope");
const colorblindSafeColorDeuteran = daltonize(originalColor, "deuteranope");
const colorblindSafeColorTritan = daltonize(originalColor, "tritanope");
console.log(`Original Color: ${originalColor}`);
console.log(`Protan-Safe Color: ${colorblindSafeColorProtan}`);
console.log(`Deuteran-Safe Color: ${colorblindSafeColorDeuteran}`);
console.log(`Tritan-Safe Color: ${colorblindSafeColorTritan}`);
// Output:
// Original Color: 255,0,0
// Protan-Safe Color: 255,129,157
// Deuteran-Safe Color: 255,51,131
// Tritan-Safe Color: 255,0,255
Contributing
๐ค Contributions are welcome! If you would like to contribute to Daltonize, please review our Contributing Guidelines for more information.
License
๐ This project is licensed under the MIT License. For more information, please refer to the LICENSE.txt file in the root directory of this repository.