JuliaAttic / Color.jl

Basic color manipulation utilities.
Other
47 stars 21 forks source link

cie_color_match(x) fails when 379<x<380 or 780<x<781 #33

Closed jiahao closed 10 years ago

jiahao commented 10 years ago
julia> cie_color_match(379.0)
XYZ(0.0,0.0,0.0)

julia> cie_color_match(380.0)
XYZ(0.001368,3.9e-5,0.006450001)

julia> cie_color_match(379.5)
ERROR: dimensions must match
 in promote_shape at operators.jl:186
 in + at array.jl:724
 in cie_color_match at /Users/jiahao/.julia/v0.3/Color/src/Color.jl:706

julia> cie_color_match(780)
XYZ(4.150994e-5,1.499e-5,0.0)

julia> cie_color_match(780.5)
ERROR: dimensions must match
 in promote_shape at operators.jl:186
 in + at array.jl:724
 in cie_color_match at /Users/jiahao/.julia/v0.3/Color/src/Color.jl:706

julia> cie_color_match(781)
XYZ(0.0,0.0,0.0)

The XYZ color transfer functions are defined in the wavelength range of 380-780 nm, so presumably this is reflecting some corner case in not correctly interpolating from the edge of the defined function to XYZ(0.0,0.0,0.0).