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-4] Correct/simplify normalization in hue interpolation #9335

Closed
yarusome opened this issue Sep 11, 2023 · 0 comments
Closed

[css-color-4] Correct/simplify normalization in hue interpolation #9335

yarusome opened this issue Sep 11, 2023 · 0 comments

Comments

@yarusome
Copy link

Since f46b5d4, any <hue> is already normalized to be within the range [0, 360), so the algorithms in 12.4.1. shorter, 12.4.2. longer, 12.4.3. increasing and 12.4.4. decreasing already work as expected without the third paragraph under 12.4. Hue Interpolation:

Both angles and their difference need to be constrained to [0, 360) prior to interpolation. To do this, the minimum number of turns that fit in the lesser angle is added or subtracted from both angles, bringing the lesser angle into the range [0,360); and if the difference between them is greater than or equal to 360° then the minimum number of turns to bring the difference into the range [0,360) is further subtracted from the greater angle.

In addition, even if the normalization of <hue> is skipped before the above paragraph, it still fails to achieve what it claims. Example: (θ₁, θ₂) = (300, 600) passes through intact.

Note: I'm opening this issue as a follow-up to #8838 because it would simplify a lot for explaining the (conditional) equivalence of short/longer and increasing/decreasing in mdn/content#28943.

Cc @svgeesus.

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

3 participants