Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
749 stars 60 forks source link

Fix Oklab from Oklch hue conversion #344

Closed tomcur closed 1 year ago

tomcur commented 1 year ago

The Oklch -> Oklab conversion currently inverts the hue by swapping the a and b components. This PR corrects the calculation and adds an Oklch -> Oklab -> Oklch roundtrip test.

Ogeon commented 1 year ago

Hi, thank you for spotting this and for taking the time to fix it (with added tests too!). It may have been a naming confusion when replacing sin_cos. Either way, I'll let the tests run through, but it looks good to me. :+1:

Ogeon commented 1 year ago

Alright, it's all green, so let's merge this.

bors r+

bors[bot] commented 1 year ago

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

tomcur commented 1 year ago

Thank you for the quick merge!

wash2 commented 1 year ago

Is there planned to be a release with this fix?

Ogeon commented 1 year ago

I'll try to get it out within the next few days. I was initially going to add CAM16 (#342) in the same release, but it turned out to be a bit trickier than expected. I'll put it to the side for a bit and add a couple of missing casting traits, and then make the release.