-
Notifications
You must be signed in to change notification settings - Fork 49
HSI->RGB conversion may return a value out of [0,1] #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
One use case where this problem become tangible is calling julia> hex(HSI(90,1,1))
ERROR: ArgumentError: element type FixedPointNumbers.Normed{UInt8,8} is an 8-bit type representing 256 values from 0.0 to 1.0,
but the values (1.0f0, 2.0f0, 0.0f0) do not lie within this range.
See the READMEs for FixedPointNumbers and ColorTypes for more information. I removed the clamping, i.e. stopped using
|
This was referenced Feb 23, 2020
I'm going to add the clamping in the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FWIW,
HSI
->RGB
conversion may return a value out of [0,1].This is not consistent with other conversions to
RGB
. However, the conversions fromHSV
andHSL
also do not check the input range.IMO, it makes sense to clamp the values which are not numerically meaningful or the values which exceed
typemin
/typemax
, but otherwise it is unnecessary.If we consider color gamuts other than sRGB, we will need to reconsider the clipping.
The text was updated successfully, but these errors were encountered: