allyfe
v0.1.6
Published
Lightweight color conversion library that converts color codes to accessible alternatives
Downloads
4
Maintainers
Readme
allyfe
🌈 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.
Install
npm i allyfe
Usage
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
.
Module
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
...
Supported Filters
deuteranopia
deuteranomaly
protanopia
protanomaly
tritanopiat
tritanomaly
achromatopsia
achromatomaly
Test
npm test
Contribute
Don't be scared raise an issue or a pull request! Any contributions, no matter how big or small will land your picture here.