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:
Emilio Cobos Álvarez 2023-08-15 00:51:30 +02:00 committed by Martin Robinson
parent 1e5079ca00
commit bc1845a8f8

View file

@ -432,9 +432,9 @@ fn adjust_hue(left: &mut f32, right: &mut f32, hue_interpolation: HueInterpolati
let delta = *right - *left; let delta = *right - *left;
if delta > PI { if delta > PI {
*left += PI; *left += TAU;
} else if delta < -1. * PI { } else if delta < -PI {
*right += PI; *right += TAU;
} }
}, },
// https://drafts.csswg.org/css-color/#longer // https://drafts.csswg.org/css-color/#longer