ajalt / colormath

Multiplatform Kotlin color conversion and manipulation
https://ajalt.github.io/colormath/
MIT License
308 stars 21 forks source link

Add support for CIE L*u*v* #9

Closed laurelkeys closed 4 years ago

laurelkeys commented 4 years ago

Hey @ajalt I saw the request for HSLuv in https://github.com/ajalt/colormath/issues/8 and thought I'd contribute the CIE L*u*v* conversions it needs 🙂

I've used this CIE Color Calculator to create the first 8 reference values in LUVTest.kt, and got the last 3 from colour-science/colour's test suite (which I double checked with the calculator), noting that they also use the D65 Standard illuminant.

I also took the liberty to include a small typo fix to Color.kt in this PR, and refactored some of the computations for the CIE L*a*b* colorspace.

If you want me to revert some of these changes, or have any other suggestions, please let me know!

ajalt commented 4 years ago

Excellent!