color.js icon indicating copy to clipboard operation
color.js copied to clipboard

Feature for checking whether a color is within the visible gamut

Open eeeps opened this issue 1 year ago • 3 comments

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).

eeeps avatar Jan 03 '24 02:01 eeeps

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.

LeaVerou avatar Feb 09 '24 19:02 LeaVerou

I'll also point to https://github.com/rodrimc/ColourGamut, which I was not able to get running.

eeeps avatar Jun 12 '24 20:06 eeeps