diff --git a/src/display.jl b/src/display.jl index 7b2385e8..c30b966b 100644 --- a/src/display.jl +++ b/src/display.jl @@ -19,9 +19,9 @@ function Base.show(io::IO, ::MIME"image/svg+xml", c::Color) """) end -function Base.show(io::IO, ::MIME"image/svg+xml", +function Base.show(io::IO, ::MIME"image/svg+xml", cs::AbstractVector{T}) where T <: Color - show(io, MIME"image/svg+xml"(), reshape(cs, (1, length(cs)))) + show(io, MIME"image/svg+xml"(), Base.ReshapedArray(cs, (1, length(cs)), ())) end function Base.show(io::IO, ::MIME"image/svg+xml", diff --git a/test/colormaps.jl b/test/colormaps.jl index 35e5a6c4..6f7f28c5 100644 --- a/test/colormaps.jl +++ b/test/colormaps.jl @@ -1,3 +1,9 @@ @testset "Colormaps" begin @test length(colormap("RdBu", 100)) == 100 + + # test ability to add to previously shown array of colors - issue #328 + a = [colorant"white", colorant"red"] + show(stdout, MIME"image/svg+xml"(), a) + push!(a, colorant"blue") + @test length(a) == 3 end