Closed tknopp closed 9 years ago
I traced it down to convert{T}(::Type{XYZ{T}}, c::Luv, wp::XYZ)
:
c::Luv
has c.u == c.v == 0.0
, the computation of a
involves the term c.l / (c.u + 13 * c.l * u_wp) == 0./0. == NaN
c::Luv
has c.l == c.v == 0.0
, the computation of d
involves the term c.l / (c.v + 13 * c.l * v_wp) == 0./0. == NaN
a == -1/3
and d==b
, the computation of x
involves the term (d - b) / (a + (1./3.) == 0./0.== NaN
Thanks, Jiahao!
Hi.
I am sorry to bother you with this closed bug, but I am still having it with the current Julia and Color versions. The command Color.colormap("Grays") still returns some Nans and any atempt to use this colormap gives BoundErrors. Is there any workaround ? x My versions: Julia: 0.3.2+2 (Windows) (6babc84*) Color: 0.3.12
Thank you, Eduardo.
This looks like a different bug.
julia> z=Color.colormap("Grays")
100-element Array{RGB{Float64},1}:
RGB{Float64}(1.0,0.9999999843772079,0.9999999986434464)
RGB{Float64}(0.9953438809796115,0.9953438395120359,0.9953438537153104)
RGB{Float64}(0.9906156490689292,0.9906156077880247,0.9906156219273617)
RGB{Float64}(0.9858143003211964,0.9858142592298492,0.98581427330426)
RGB{Float64}(0.9809387935584134,0.9809387526595515,0.9809387666680328)
RGB{Float64}(0.9759880764437571,0.9759880357403498,0.975988049681885)
RGB{Float64}(0.9709610855361143,0.9709610450311729,0.970961058904731)
RGB{Float64}(0.9658567463560132,0.965856706052591,0.9658567198571254)
RGB{Float64}(0.960673973463667,0.9606739333648607,0.9606739470993128)
RGB{Float64}(0.9554116705498868,0.9554116306588364,0.9554116443221273)
RGB{Float64}(0.9500687305406562,0.9500686908605455,0.9500687044515875)
RGB{Float64}(0.9446440357162313,0.9446439962502874,0.9446440097679738)
RGB{Float64}(0.9391364578456477,0.9391364185971429,0.9391364320403532)
RGB{Float64}(0.9335448583376053,0.9335448193098572,0.9335448326774552)
RGB{Float64}(0.927868088408735,0.9278680496051054,0.9278680628959401)
RGB{Float64}(0.9221049892703218,0.9221049506942189,0.9221049639071214)
⋮
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(NaN,NaN,NaN)
RGB{Float64}(0.0,0.0,0.0)
Still present in current git version, with nightly julia version:
julia> Color.colormap("Grays", 4)
4-element Array{Color.RGB{Float64},1}:
Color.RGB{Float64}(1.0,0.9999999843772079,0.9999999986434464)
Color.RGB{Float64}(0.8022332446272302,0.8022332107836626,0.8022332223756009)
Color.RGB{Float64}(NaN,NaN,NaN)
Color.RGB{Float64}(0.0,0.0,0.0)
I've traced it down to the following bug:
julia> p = Color.LCHuv{Float64}(0.0,0.0,0.0); 1.0p
Color.LCHuv{Float64}(0.0,NaN,NaN)
As Tim observed in #58, the gray colormap has a wrong last value that contains NaNs instead of zeros. This used to work at a former version of Color.jl