JuliaAttic / Color.jl

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

Error constructing RGBA color #61

Open ssfrr opened 9 years ago

ssfrr commented 9 years ago
julia> c1 = RGB(0.5, 0.1, 0.6)
#  RGB{Float64}(0.5,0.1,0.6)

julia> c2 = RGBA(0.6, 0.1, 0.9, 1)
#  ERROR: SYSTEM: show(lasterr) caused an error
timholy commented 9 years ago

Agreed that this is really annoying. The problem is that RGBA is a typealias, and you can't define constructors for type aliases. https://github.com/JuliaLang/julia/issues/1470

However, there's a workaround: c2 = RGBA{Float64}(0.6, 0.1, 0.9, 1). We just can't provide that default version that fills in the {Float64} for you.

timholy commented 9 years ago

If it makes your life better, though, consider contributing methods like rgba(0.6, 0.1, 0.9, 1).