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

Contrast Ratio Calculation #75

Closed
jsfi opened this issue Nov 19, 2015 · 5 comments
Closed

Contrast Ratio Calculation #75

jsfi opened this issue Nov 19, 2015 · 5 comments

Comments

@jsfi
Copy link

jsfi commented Nov 19, 2015

Hi,
I am working with your library in a current project and need contrast ratio calculation between two colors.

Would you consider a pull request to add this functionality?

Thank you for your work on the library.

@Qix-
Copy link
Owner

Qix- commented Nov 19, 2015

Hi there!

Can you elaborate a bit on exactly what you'd like to have added?

@jsfi
Copy link
Author

jsfi commented Nov 19, 2015

Sorry if this was a bit short.

I believe that the calculation of the contrast ratio between two colors as defined by the W3C would be a good addition to the library.

Lea Verou implemented this calculation for a Web-Tool and I adapted it to use it with your library.

So my question was if you would be interested that I add my adaption inside the library or do you consider it out of scope.

@Qix-
Copy link
Owner

Qix- commented Nov 19, 2015

I would consider it out of scope simply because it's a destructive calculation. For instance, you can derive a ratio between two colors, but a single color cannot result in a contrast ratio and vice versa a contrast ratio cannot be used to create a specific color, hence landing this outside the scope of this library.

Unless, that is, I'm misunderstanding the concept here (which is entirely possible).

@jsfi
Copy link
Author

jsfi commented Nov 19, 2015

What you described was my main concern why I wanted to ask before doing anything.

Thank you for your time.

@jsfi jsfi closed this as completed Nov 19, 2015
@Qix-
Copy link
Owner

Qix- commented Nov 19, 2015

No problem! Thank you for the issue :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants