Hello,
thanks for this useful header file.
Using it I've noticed the RGB2HSL function expects RGB values between 0 and 255, while the HSL2RGB returns RGB values between 0 and 1. Thus, if you take an RGB color, convert it to HSL and back to RGB, the result is not the original color.
Just deleting the first 3 lines of RGB2HSL (or alternatively adding a multiplication by 255 at the end of HSL2RGB) fixes the issue.
Best regards.