The saturation calulation for RGB to HSL has a small bug.
On line HslAndRgbConverter.cs#L99 https://github.com/SixLabors/ImageSharp/blob/be5c99f57f853607b326c1cd2d2eb73b43f80a7b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Converters/HslAndRgbConverter.cs#L99
the calculation should be
s = chroma / (2F - max - min);
(Looks like an optimization mistake: chroma=max-min, but 2F-max-min is not 2F-chroma)
@mgkeeley can you provide a few pairs of (inputRgb, expectedOutputHsl) values reproducing the issue?
The issue occurs when the Lightness value > 0.5:
Rgb(0.7, 0.8, 0.1) -> Hsl(68.57, 0.78, 0.45) (correct)
Rgb(0.7, 0.8, 0.6) -> Hsl(90, 0.11, 0.7) incorrect - should be Hsl(90, 0.33, 0.7)
thank you for your swift response :-)
No worries! It was me who did the bad optimization 馃ぃ