Skip to content

Commit 120af90

Browse files
committed
[css-color-5] Guarded against division by zero in color-mix() algorithm #14013
1 parent ea43807 commit 120af90

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

css-color-5/Overview.bs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ Otherwise, use the specified colorspace for mixing.
314314
Let |combined percentage| be the sum of |a| and |b|’s percentages.
315315
2. Interpolate |a| and |b|’s colors
316316
as described in [[css-color-4#interpolation]],
317-
with a progress percentage equal to <code>(|b|’s percentage) / |combined percentage|)</code>.
317+
with a progress percentage equal to
318+
<code>(|b|’s percentage) / |combined percentage|)</code>,
319+
if |combined percentage| is greater than 0,
320+
and 0.5 otherwise.
318321
If the specified color space is a [=cylindrical polar color=] space,
319322
then the <<hue-interpolation-method>> controls the
320323
interpolation of hue, as described in

0 commit comments

Comments
 (0)