A proposal and draft spec for a Color object for the Web Platform, loosely influenced by the Color.js work. Heavily WIP, if you landed here randomly, please move along.
In #4, we changed the color space coords to specify metadata instead of just a list of names.
One piece of this metadata is a gamut range, through min and max properties.
However, color spaces also have an inGamut() method.
How do these interact?
Option 1: We remove min and max from the coord spec. colorSpace.inGamut() is now the only way to check if a color is in gamut.
Option 2: If colorSpace.inGamut() is not specified, it is generated based on these ranges. Otherwise, these ranges are ignored.
Option 3: For a color to be in gamut, it needs to pass both of these tests, if both are specified.
Option 4: We drop colorSpace.inGamut(). None of the color spaces we support rn needs it (they can be served just fine with range checking), I think it was primarily added to cater to ICC profile use cases.
In #4, we changed the color space coords to specify metadata instead of just a list of names. One piece of this metadata is a gamut range, through
min
andmax
properties.However, color spaces also have an
inGamut()
method. How do these interact?min
andmax
from the coord spec.colorSpace.inGamut()
is now the only way to check if a color is in gamut.colorSpace.inGamut()
is not specified, it is generated based on these ranges. Otherwise, these ranges are ignored.colorSpace.inGamut()
. None of the color spaces we support rn needs it (they can be served just fine with range checking), I think it was primarily added to cater to ICC profile use cases.