Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Accessibility functions #187

Closed
Dallas62 opened this issue Nov 23, 2020 · 1 comment
Closed

[Feature request] Accessibility functions #187

Dallas62 opened this issue Nov 23, 2020 · 1 comment

Comments

@Dallas62
Copy link

Hi,

I'm currently using this library to define color variations of the design system, and I was looking at some color palette tool such as Coolors which provide some accessibility tools.
For exemple:
Capture d’écran 2020-11-23 à 14 36 58

It would be great to get an API to generate this color, such as:

Color('#FFAA00').filter('protanopia').hex(); // #DAD929

And It would be cool to get a global configuration, such as:

Color.global.filter = 'protanopia';

Color('#FFAA00').hex(); // #DAD929

This would help to switch the interface into blindness colors and test close to their perceptions.

Regards,

@Qix-
Copy link
Owner

Qix- commented Nov 23, 2020

It would be great to get an API to generate this color, such as:

This is a wonderful case for releasing your own package based on color :)

const Color = require('color'); // this package
const { protanopia } = require('color-a11y'); // your own package, perhaps

const filteredColor = protanopia(Color('#FFAA00')).hex(); // #DAD929

And It would be cool to get a global configuration, such as:

Global filters would be an anti-pattern here as it would affect all users of the package, so it's something I won't expressly support.


color-a11y is free as of writing on NPM, so feel free to create a package for it :) I would personally use it!

However, I don't see it being useful for the 80% of users that use this package, whereas a dedicated package would make a lot of sense here.

Good idea though :)

@Qix- Qix- closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants