Skip to content

Commit

Permalink
fix parse Colorant
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Feb 21, 2025
1 parent dce0067 commit e9e9322
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rendering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ using FileIO
using ImageTransformations
include("svg.jl")
# because of float error, (randommask(color=Gray(0.3))|>tobitmap)[300,300]|>torgba != Gray(0.3)|>torgba
parsecolor(c) = ARGB{Colors.N0f8}(parse(Colorant, c))
parsecolor(c) = parsecolor(parse(Colorant, c))
parsecolor(c::Colorant) = ARGB{Colors.N0f8}(c)
parsecolor(c::Colors.N0f8) = c
parsecolor(tp::Tuple) = ARGB{Colors.N0f8}(tp...)
parsecolor(gray::Real) = ARGB{Colors.N0f8}(Gray(gray))
parsecolor(sc::Symbol) = parsecolor.(colorschemes[sc].colors)
Expand Down

0 comments on commit e9e9322

Please sign in to comment.