Open Mischback opened 1 year ago
808bbaea83a1a317d6863845d6841ec026d250f6 has (working) RGB and OkLCH inputs. However, the colors are not matching, most likely because of the internal conversion to Nope, see #36 for a description of this bug!XYZ
and re-conversion into the actual color spaces / input methods.
The simple clipping is not sufficient to align the colors properly! Despite #36, this is still true and applies when use (i.e.) OkLCH
input.
Internally, colors are stored in
CIE XYZ D65
colorspace, which is really big (meant to provide the means to describe all visible colors). The different input methods are working on their respective color spaces (e.g.sRGB
andOklch
), which are not congruent.Colors must be forced into the color space's gamut. The easiest way is to just clip values, that are outside of the expected range, e.g. for
sRGB
values< 0
and> 1
.Currently this is the most basic implementation, just discarding these values. Might need more attention!
Resources
colorjs
/coluri
and apply to our codebase