mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
style: Fix hue adjustment to match the spec
The value to sum is tau, not pi. This was caught by some tests, see https://drafts.csswg.org/css-color/#shorter Differential Revision: https://phabricator.services.mozilla.com/D147006
This commit is contained in:
parent
1e5079ca00
commit
bc1845a8f8
1 changed files with 3 additions and 3 deletions
|
@ -432,9 +432,9 @@ fn adjust_hue(left: &mut f32, right: &mut f32, hue_interpolation: HueInterpolati
|
|||
let delta = *right - *left;
|
||||
|
||||
if delta > PI {
|
||||
*left += PI;
|
||||
} else if delta < -1. * PI {
|
||||
*right += PI;
|
||||
*left += TAU;
|
||||
} else if delta < -PI {
|
||||
*right += TAU;
|
||||
}
|
||||
},
|
||||
// https://drafts.csswg.org/css-color/#longer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue