Skip to content

Commit 28f72c1

Browse files
committed
[css-color-5] Removed special casing of 100% from the color-mix() algorithm, thus avoiding a discontinuity near fully-transparent colors w3c#14014
1 parent 120af90 commit 28f72c1

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

css-color-5/Overview.bs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,14 @@ Otherwise, use the specified colorspace for mixing.
295295
1. [=Normalize mix percentages=] from the list of [=mix items=] passed to the function,
296296
with the "forced normalization" flag set to true,
297297
letting |items| and |leftover| be the result.
298+
<!--
298299
2. If |leftover| is 100%,
299300
return [=transparent black=],
300-
converted to the specified interpolation <<color-space>>.
301-
3. Let |alpha mult| be <code>1 - |leftover|</code>,
301+
converted to the specified interpolation <<color-space>>.
302+
-->
303+
2. Let |alpha mult| be <code>1 - |leftover|</code>,
302304
interpreting |leftover| as a number between 0 and 1.
303-
4. If |items| is length 1,
305+
3. If |items| is length 1,
304306
set |color| to the color of that sole item,
305307
converted to the specified interpolation <<color-space>>.
306308

@@ -328,8 +330,8 @@ Otherwise, use the specified colorspace for mixing.
328330
and a percentage of |combined percentage|,
329331
and [=stack/push=] it onto |item stack|.
330332
3. Set |color| to the color of the sole remaining item in |item stack|.
331-
5. Multiply the alpha component of |color| by |alpha mult|.
332-
6. Return |color|.
333+
4. Multiply the alpha component of |color| by |alpha mult|.
334+
5. Return |color|.
333335

334336
Note: In [=cylindrical polar color=] spaces,
335337
mixing is order-dependent,

0 commit comments

Comments
 (0)