Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/azerella/allyfe
- Owner: azerella
- License: mit
- Created: 2018-02-26T22:40:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-27T07:46:05.000Z (almost 6 years ago)
- Last Synced: 2024-12-11T00:40:15.564Z (about 2 months ago)
- Topics: accessibility, color, color-blindness, nodejs, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/allyfe
- Size: 30.3 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.
[badge_coffee_donate]: https://adamzerella.com/badges/coffee.svg
[badge_paypal_donate]: https://adamzerella.com/badges/paypal.svg