I am trying to convert a HSL value to RBG using the Data.Colour module. Hackage doc said that Hue always in the range of 0-360. But now there are ranges of Saturation and Lightness values. Are they in [0,100] or in the ranges [0,1]?
I assume the first option is right, but it seems like it is not.
Ξ»> hsl 100 50 50 RGB {channelRed = 866.6666666666692, channelGreen = -2400.0, channelBlue = 2500.0}
Than I tried to use the range [0, 1] for saturation and ease.
Ξ»> fmap truncate . (\(h,s,l) -> hsl hsl) $ (0,0,0) RGB {channelRed = 0, channelGreen = 0, channelBlue = 0} it :: RGB Integer
That's why I'm starting to think that only Saturation should be Double in [0,1] .
For example, we have some color value in HSL format.
Ξ»> let c = (34.0,0.54,68.0) c :: (Double, Double, Double)
Then we convert it to RGB and crop all the values
Ξ»> fmap truncate . (\(h,s,l) -> hsl hsl) $ c RGB {channelRed = 31, channelGreen = 63, channelBlue = 104}
But (31,63,104)::RGB is (214,54,26)::HSL like some online color converters .
What am I doing wrong?