My understanding of the function float doesn't peel off the Colorant wrapper: float(::Gray) will still be a Gray, float(::RGB) will still be an RGB, etc. Similar usages are float64, n0f8, etc.
julia> using Colors
julia> float(Gray{Float64}(0.5))
0.5
julia> using ImageCore
julia> float(Gray{Float64}(0.5))
Gray{Float64}(0.5)
We should probably unsupport float/real here. And let the users decide if it's still the Colorant. If the purpose is to peel off the colorant wrapper, use the "standard" API gray. @timholy how do you think?
@myrddin89 noticed this in https://github.com/JuliaGraphics/ColorTypes.jl/issues/123#issuecomment-1271826700
My understanding of the function
float
doesn't peel off the Colorant wrapper:float(::Gray)
will still be aGray
,float(::RGB)
will still be anRGB
, etc. Similar usages arefloat64
,n0f8
, etc.We should probably unsupport
float
/real
here. And let the users decide if it's still the Colorant. If the purpose is to peel off the colorant wrapper, use the "standard" APIgray
. @timholy how do you think?