Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/azerella/allyfe

🌈 Convert color codes using color blindness profiles.
https://github.com/azerella/allyfe

accessibility color color-blindness nodejs npm

Last synced: about 1 month ago
JSON representation

🌈 Convert color codes using color blindness profiles.

Awesome Lists containing this project

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.

[![Coffee][badge_coffee_donate]](https://www.buymeacoffee.com/adamzerella)
[![PayPal][badge_paypal_donate]](https://www.paypal.me/adamzerella)

## Install

```javascript
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

```javascript
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

```bash
deuteranopia
deuteranomaly
protanopia
protanomaly
tritanopiat
tritanomaly
achromatopsia
achromatomaly
```

## Test

```javascript
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

[badge_coffee_donate]: https://adamzerella.com/badges/coffee.svg
[badge_paypal_donate]: https://adamzerella.com/badges/paypal.svg