Skip to content

Commit

Permalink
Allow passing colorscheme as symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Nov 18, 2023
1 parent 0395c7a commit 61d6df2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ribbon/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ end
function render!(
container,
protein::Protein;
colorscheme::ColorScheme = ColorSchemes.jet,
colorscheme::Union{ColorScheme, Symbol} = :jet,
color_vectors::AbstractVector{C} = [LinRange(0, 1, length(chain)) for chain in protein],
) where C <: AbstractVector{<:Union{Real, RGB}}
colorscheme isa Symbol && (colorscheme = colorschemes[colorscheme])
if eltype(C) <: Real
color_vectors = [colorscheme[color_vector] for color_vector in color_vectors]
end
Expand Down

0 comments on commit 61d6df2

Please sign in to comment.