🌈 Lightweight color conversion library that converts color codes to accessible alternatives
I'm aspiring to make open-source my full-time work. If you like the work that I do, please consider supporting me.
npm i allyfe
Turn a valid color code into an accessible alternative using color-blindness filters. For example, red
to a person with deuteranopia would look something like #0000B3
.
const { AllyFe, Filter } = require ( 'allyfe' );
AllyFe( Filter.deuteranopia, 'red' ); // Returns #9FB300
AllyFe( Filter.deuteranopia, '#ff0000' )) // Returns #9FB300
AllyFe( Filter.tritanomaly, 'red' ); // Returns #F70000
AllyFe( Filter.tritanomaly, 'hsl( 0, 100%, 50% )' ) // Returns #F70000
AllyFe( Filter.protanopia, 'rgb( 255,0,0,1 )' ) // Returns #918E00
...
deuteranopia
deuteranomaly
protanopia
protanomaly
tritanopiat
tritanomaly
achromatopsia
achromatomaly
npm test
Don't be scared raise an issue or a pull request! Any contributions, no matter how big or small will land your picture here.