- From: Sam Weinig via GitHub <noreply@w3.org>
- Date: Thu, 04 Jun 2026 20:32:33 +0000
- To: public-css-archive@w3.org
weinig has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-color-5] Remove special casing of 100% leftover from the color-mix() calculation algorithm == The [color-mix() calculation algorithm](https://drafts.csswg.org/css-color-5/#calculate-a-color-mix) currently special cases a leftover value of 100% (which happens if all the percentages were specified as 0%) in step 2: > 2. If leftover is 100%, return [transparent black](https://drafts.csswg.org/css-color-4/#transparent-black), converted to the specified interpolation. We already have to handle the case of 0% values in the color-mix(), for cases where 0% is used but not for all the items, (e.g. `color-mix(in srgb, red 0%, blue 0%, green 100%)`), so the special casing should not be necessary to get a result. (NOTE: Currently, there is an issue with division by zero here, see https://github.com/w3c/csswg-drafts/issues/14013, so this is assuming we resolve that). Removing step 2 would result in slightly different values, they would always be 100% transparent, due to 100% leftover translating to 0% alpha, but would no longer always be specifically [transparent black](https://drafts.csswg.org/css-color-4/#transparent-black). The benefit of this, other than simplifying the algorithm, would be to remove a discontinuity when iteratively reducing the percentages (e.g. the difference between `color-mix(in srgb, red 0.1%, blue 0.1%)` and `color-mix(in srgb, red 0%, blue 0%)`, and maintaining powerless/none values (e.g. `color-mix(in srgb, color(srgb none 0 1) 0%, color(srgb none 1 0) 0%)`. cc @svgeesus Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/14014 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 4 June 2026 20:32:34 UTC