W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

[csswg-drafts] [css-color-5] What's the use case for color-mix() per-component adjusters? (#5192)

From: Lea Verou via GitHub <sysbot+gh@w3.org>
Date: Thu, 11 Jun 2020 07:09:02 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-636775563-1591859340-sysbot+gh@w3.org>
LeaVerou has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] What's the use case for color-mix() per-component adjusters? ==
https://drafts.csswg.org/css-color-5/#colormix

I've looked again at @una's original proposal in https://gist.github.com/una/edcfa0d3600e0b89b2ebf266bf549721 but I can't find it there either.

What is the use case for mixing two colors with different percentages for each component, like in [this example](https://drafts.csswg.org/css-color-5/#example-10edb418)? 

```css
color-mix(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) hue(75.23%) lightness(68.4%));
```

I had trouble wrapping my head around these examples, as they seem to basically be trying to do color adjustment and interpolation together in one, pre-computed step.

Every use case I have ever seen for a color mixing function in preprocessors involves interpolation of all components together. Any use case I can think of for separate interpolation percentage per component is basically contorting `color-mix()` to do something that `color-adjust()` or the relative color functions do better (e.g. creating lighter/darker/muted variants).

I may be missing something, but I would propose keeping `color-mix()` sweet and simple with only colors, percentage, and color space, and offloading color manipulation onto `color-adjust()`/relative color functions, at least for now.

But @una has worked more with design systems, so hopefully she had some use cases in mind for the extended syntax?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5192 using your GitHub account
Received on Thursday, 11 June 2020 07:09:03 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:27 UTC