fix single-color case for plotly
This commit is contained in:
parent
d8f0612f5a
commit
7cc60d0b0c
@ -437,7 +437,7 @@ end
|
||||
plotly_colorscale(c, α) = plotly_colorscale(cgrad(alpha=α), α)
|
||||
function plotly_colorscale(c::AbstractVector{<:RGBA}, α)
|
||||
if length(c) == 1
|
||||
return [[0.0, rgba_string(plot_color(c[1], α))]]
|
||||
return [[0.0, rgba_string(plot_color(c[1], α))], [1.0, rgba_string(plot_color(c[1], α))]]
|
||||
else
|
||||
vals = linspace(0.0, 1.0, length(c))
|
||||
return [[vals[i], rgba_string(plot_color(c[i], α))] for i in eachindex(c)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user