allyfe
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

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.

Coffee PayPal

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.

Adam Zerella

/allyfe/

    Package Sidebar

    Install

    npm i allyfe

    Weekly Downloads

    4

    Version

    0.1.6

    License

    MIT

    Unpacked Size

    13.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • azerella