facelessuser / coloraide

A library to aid in using colors
https://facelessuser.github.io/coloraide
MIT License
194 stars 12 forks source link

Improve the ray trace algorithm to yield better results in all spaces #435

Closed facelessuser closed 1 month ago

facelessuser commented 1 month ago

The ray trace approach was designed focusing mainly on Oklab/OkLCh. Further evaluation shows that some spaces twist a little different through the RGB spaces and can yield results not as good, CIELCh being an example.

Adjust the algorithm so that if a point is found along the reduction path below the gamut surface, that point becomes the new anchor.

This generally tightness the range in a few passes and prevent some spaces from having larger than expected hue or lightness deviations.

facelessuser commented 1 month ago

@gir-bot lgtm