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

[css-color] test conversion lossiness in relative color syntax #45148

Conversation

romainmenke
Copy link
Contributor

@romainmenke romainmenke commented Mar 16, 2024

Relative color syntax is expected to be somewhat resilient to cumulative errors.
Converting from A to B and back to A should result in the original value up to a some precision. This is only a single round trip.

I am making the assumption that implementers are using either xyz-d50 or xyz-d65 as intermediary space to convert color values for features like color-mix and relative color syntax. This is also what I did.

This tests that converting from xyz-d50 to another notation and back results in the original value. The same for xyz-d60.

It is currently unspecified what the internal precision must be for color values.
css-color-4 only defined precision for serialization. I've now used 5 decimal places which I think is fairly reasonable. It based on the serialization precision for color(xyz ...), which is 16 bits.

@romainmenke romainmenke changed the title [css-color] test conversion lossiness [css-color] test conversion lossiness in relative color syntax Mar 16, 2024
@svgeesus svgeesus merged commit d728fdc into web-platform-tests:master Mar 18, 2024
19 checks passed
@romainmenke romainmenke deleted the css-color-test-conversion-lossiness--resourceful-pekingese-64ad5cfa3d branch March 18, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants