Different Lab implementations? #501
-
When I create a Lab color in color.js using CSS implementations seem to differ. Using the css color My best guess is that the tools producing red are clipping the conversion to rgb. The color.js conversion tool referenced above shows raw coordinates for srbg as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are inconsistencies across browsers currently. Colors outside of the display gamut must be gamut mapped to the displayable gamut, and depending on the rules the browser is following, this could be different. In the CSS spec, at one time, it was mentioned when lightness is 0% or 100% that the a and b were powerless, I think that was later removed in favor of letting gamut mapping take care of putting the color into gamut. Some browsers may follow this rule though. Then there is the suggested CSS gamut mapping algorithm which reduces chroma until the color fits into the gamut. This preserves lightness and hue. At zero lightness, chroma would get reduced to zero creating a black color. I don't think any browser does this currently, and if they do some form of this, it is behind an experimental flag. The other gamut mapping approach is simply clipping channel values that exceed the gamut. This does in fact, as you guessed, create a maroon color for those values. It will probably be some time before browsers finish fixing all the issues. In addition to just variations due to bugs, they still haven't agreed to do anything similar to the CSS suggested gamut mapping algorithm. It may be that the final solution to display out of gamut colors that browsers adopt could be different. At some point, hopefully, the results will be similar across all browsers. |
Beta Was this translation helpful? Give feedback.
There are inconsistencies across browsers currently. Colors outside of the display gamut must be gamut mapped to the displayable gamut, and depending on the rules the browser is following, this could be different.
In the CSS spec, at one time, it was mentioned when lightness is 0% or 100% that the a and b were powerless, I think that was later removed in favor of letting gamut mapping take care of putting the color into gamut. Some browsers may follow this rule though.
Then there is th…