- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Thu, 02 Jul 2020 04:09:44 +0000
- To: public-css-archive@w3.org
LeaVerou has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-color-5] Omitted adjuster logic for color-mix() == Based on various examples in the spec and in issues, it appears that if any adjusters are present, the remaining adjusters default to 0%, i.e. the whole component of the other color. However, this was not actually part of the prose, so I've done some work to add this logic alongside other editing to flesh out how this is supposed to work. However, since per #5258 we can have percentages and adjusters **on each color**, this becomes trickier. I've written [a list of steps](https://drafts.csswg.org/css-color-5/#color-mix) to normalize the arguments to a list of adjusters, to make it more predictable how they combine (especially when combining percentages and adjusters), so it can pave the way to [multiple colors](https://github.com/w3c/csswg-drafts/issues/4711). It currently says: > Adjusters that are not present on a color default to 0% (i.e. the corresponding components are taken from the other color). However, this would mean that e.g. `color-mix(color1 hue 20%, color2 chroma 20%)` becomes `color-mix(color1 hue 20% chroma 80% lightness 0%, color2 hue 80% chroma 20% lightness 0%)` when normalized, which I suppose we could define the scaling algorithm so that equal percentages end up being normalized to `lightness 50%`, but still. And while we're at it, what would missing percentages default to? I.e. what is `color-mix(color1 hue, color2)`? cc @svgeesus @una @argyleink Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5279 using your GitHub account
Received on Thursday, 2 July 2020 04:09:46 UTC