[Standards] XEP-0392 (Consistent Color Generation): Include HSLuv conversion formula

Paul Schaub vanitasvitae at fsfe.org
Wed Jul 10 21:10:39 UTC 2019


Hi everyone!

I recently updated my implementation of XEP-0392 to version 0.6.0 and I
ended up having to include a third party library to get my
implementation to match the provided test vectors.

The XEP states:
"Use the HSLuv operation hsluvToRgb to convert the Hue angle to a color."

Searching for that function yields some promising results, eg.

https://www.rapidtables.com/convert/color/hsl-to-rgb.html

but if I try to actually use the formulas written on that page
(wikipedia as well), I'm not getting the right results.

If I instead incorporate

https://github.com/hsluv/hsluv-java

in my code, I end up with the correct vectors. Unfortunately I cannot
manage to substitute the library with my own code, as the library does
some rather complicated calculations via yet another color space.

I know, this is a very low priority request and there are other XEPs
that heavily depend on loosely specified library code *cough* OMEMO
*cough*, but it would be nice, if the actual conversion function
hsluvToRgb would be included as a formula in the XEP.

Happy Hacking!


More information about the Standards mailing list