Re: [csswg-drafts] [css-color-5] Proposal: Add dlm() as a CSS color space to represent spectral color mixing (#14356)

@Scratchy2 Okay, that makes sense. I've updated my implementation with what you described. In some cases, values may be a little different, but that is only due to the results being more precise. For all intents and purposes, the overall algorithm is the same.

`color(rec2020 1 0 0)` and `color(display-p3 1 0 0)` won't quite round trip exactly, but that is as I thought, as they fall ever so slightly out of the visible spectrum based on rounding, etc. This isn't exactly a problem with DLM, just the way it works out.

With everything being relative to 650nm, as things approach 650nm, numerically things get unstable, so in order to compensate for that and keep M values low, some exactness is lost. So, ultimately, everything will be most precise within the spectral locus.

Anyway, it is definitely an easier way to pick colors within the spectral locus:

<img width="800" height="800" alt="Image" src="https://github.com/user-attachments/assets/392f9666-99f7-4fbe-aaee-3f0436bd0c75" />



-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/14356#issuecomment-5388289837 using your GitHub account


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

Received on Sunday, 23 August 2026 20:28:00 UTC