[csswg-drafts] [css color-mix] Feature request: Physical color mixing option (Kubelka-Munk) (#8715)

NateBaldwinDesign has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css color-mix] Feature request: Physical color mixing option (Kubelka-Munk) ==
Regarding https://www.w3.org/TR/css-color-5/#funcdef-color-mix

## Overview
Incorporate a *physical color mixing* option (eg Kubelka–Munk) alongside the current interpolation options for the css `color-mix()` function.

## Why am I making this request?
Interpolations in perceptual color spaces are great and have many uses; however the title of the spec feature ("mix") implies a far different behavior of color. Interpolating at a certain percentage from one color to another is not the same as "mixing" colors in the physical world. While I can appreciate it's a more human-friendly term than "color-interpolate()" it almost begs for better methods of returning a "mixed" color.

Many people are unfamiliar with the behavior of light, light mixing, perceptual space, and color interpolation. Supporting a function that returns colors that closely resemble their physically mixed counterparts may do well for meeting the expectations of certain people. At the very least, it would be a good addition to the options, considering each color space/method returns different results, and the decision on which to use can be highly subjective.

I would love to see the addition of a physical color mixing approach, such as [Kubelka–Munk](https://en.wikipedia.org/wiki/Kubelka%E2%80%93Munk_theory), which more closely reflects the physical result of mixing colors. Examples of this method in implementation can be found here: https://github.com/scrtwpns/mixbox and here: https://github.com/rvanwijnen/spectral.js

## Related images
Here's an example of interpolation between `#002286` and `#fdd200` in a variety of color spaces:
<img width="596" alt="image" src="https://user-images.githubusercontent.com/13972198/231981069-e1443f62-db91-4f9d-a294-35d898c3baa9.png">

And another of OKLCh
<img width="959" alt="image" src="https://user-images.githubusercontent.com/13972198/231981661-c7da1bc8-991b-4f82-b5bf-e88699a842db.png">

For comparison against a Kubelka-Munk mixing of the two colors, we can see that the green is much deeper and richer (two examples):
<img width="806" alt="image" src="https://user-images.githubusercontent.com/13972198/231982724-1761e0a5-873f-47dd-a987-d21180685818.png">

<img width="827" alt="image" src="https://user-images.githubusercontent.com/13972198/231982381-a19ca050-b80c-4c75-b48d-caf60acac4c0.png">



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8715 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 14 April 2023 08:10:36 UTC