The Hakell library hip allows to do 2D images processing and it provides several color spaces, such as the well known RGB space.
I'm using this hip library to do some 2D images.
For example, I did this image with the RGB color space using a custom color map (and an elliptic function)
Now I would like to use another color map with the HSI color space. I don't understand what happens: each time my color map calculates a H (hue) value, I get an error such as "*** Exception: HSI pixel is not properly scaled, Hue: 120.0". However the doc found on Google claims that the H value ranges from 0 to 360. So why a value such as 120.0 is not valid?

The doc of hip itself says nothing about the range but we can look at the code:
Here is the relevant source code. However not everyting is defined, such as
getRGB, but after many trials-errors, I managed to understand.It is clear from this code that the range of H is not [0, 360], but rather [0, 1] or [0, 2pi] (we will see).
Based on this code, I made some progress. First, the range is indeed not [0, 360], contrary to the Google claims.
Here is my color map:
Observe this line:
let h = min (arg/2/pi) 0.9999999. The rest is the stuff for my color map. The H value (denoted byhhere) ranges from 0 to almost 1. I don't take exactly 1 because I encountered someNaNwhen the value was exactly 1.Moreover, my experiments show that S and I must lie between 0 and 1 I think, not between 0 and 100 as claimed on Google.
Finally it works, but this color map is not pretty for this example: