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

Convert colors via Lab colorspace #10

Closed
jonathantneal opened this issue Jan 27, 2018 · 0 comments · Fixed by #12
Closed

Convert colors via Lab colorspace #10

jonathantneal opened this issue Jan 27, 2018 · 0 comments · Fixed by #12

Comments

@jonathantneal
Copy link
Member

What makes gray() special is that it is perceptual. According to CSS Color Module Level 4:

gray() = gray( <number>  [, <alpha-value>]? )

The first argument specifies the shade of gray, equal to the CIE Lightness, while the second optional argument specifies the alpha channel of the gray.

And is specifically called out in the editor’s draft:

Note: In other words, gray(a / b) is equal to lab(a 0 0 / b)

This means we’ll want to use Lab to calculate the shade of gray. It looks like you are currently using RGB to determine the shade of gray.

While fixing this creates a breaking change, I do recommend changing this plugin to follow the specification.

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

Successfully merging a pull request may close this issue.

1 participant