color.js
color.js copied to clipboard
Feature for checking whether a color is within the visible gamut
aka the MacAdam Limit https://en.wikipedia.org/wiki/Gamut#Surfaces
My use case is visualizing the visible gamut, but I suspect there are others (e.g., alerting CSS authors that a color is not only outside common display gamuts, but imaginary).
Some relevant papers:
In terms of API, inGamut() already accepts strings for color space ids, we could also accept something like "spectral locus" if we want to be fancy or something simpler like "human" (my preference).
Not sure if we syntactically need to distinguish these special keywords from color space ids (e.g. special:human instead of just human). How likely are we to have many of them? I remember another gamut-only thing in #317. If we already have two, this makes me lean towards prefixing.
I'll also point to https://github.com/rodrimc/ColourGamut, which I was not able to get running.