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

fix(color-contrast): support CSS 4 color spaces #4020

Merged
merged 4 commits into from
May 15, 2023
Merged

Conversation

straker
Copy link
Contributor

@straker straker commented May 12, 2023

Adds support for hwb(), lab(), lch(), oklab(), and oklch() color spaces

Closes: #4007

@straker straker requested a review from a team as a code owner May 12, 2023 15:16
@straker straker changed the title fix(color-contrast): support css 4 color spaces fix(color-contrast): support CSS 4 color spaces May 12, 2023
assert.equal(c.blue, 200);
assert.equal(c.alpha, 1);
});
it.skip('allows exponent numbers', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colorjs doesn't handle this, but we decided that's ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should open an issue for this with colorjs.

Sandrakay49

This comment was marked as spam.

it('allows oklab', () => {
const c = new Color();
c.parseColorFnString('oklab(0.697 -0.107 0.023)');
assert.equal(c.red, 77);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, chrome devtools gives me 76 for this. 🤷

@ljharb
Copy link
Contributor

ljharb commented Aug 14, 2023

Caused #4127

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 this pull request may close these issues.

Axe fails with new color spec
4 participants