Skip to content

Commit

Permalink
Allow Cycled colors to be passed with transparency like normal colors
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Feb 7, 2024
1 parent f92b260 commit 71c52fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed an issue where CairoMakie would unnecessarily rasterize polygons [#3605](https://github.com/MakieOrg/Makie.jl/pull/3605).
- Added `PointBased` conversion trait to `scatterlines` recipe [#3603](https://github.com/MakieOrg/Makie.jl/pull/3603).
- Allowed Cycled colors to be passed with transparency as `(Cycled(n::Int), 0.4)` [#3611](https://github.com/MakieOrg/Makie.jl/pull/3611).

## [0.20.7] - 2024-02-04

Expand Down
4 changes: 4 additions & 0 deletions src/makielayout/blocks/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,10 @@ function to_color(scene::Scene, attribute_name, cycled::Cycled)
return attr_palette[mod1(index, length(attr_palette))]
end

function to_color(scene::Scene, attribute_name, cycled::Tuple{<: Cycled, <: Real})
return Colors.alphacolor(to_color(scene, attribute_name, cycled[1]), cycled[2])

Check warning on line 701 in src/makielayout/blocks/axis.jl

View check run for this annotation

Codecov / codecov/patch

src/makielayout/blocks/axis.jl#L700-L701

Added lines #L700 - L701 were not covered by tests
end

function add_cycle_attributes!(@nospecialize(plot), cycle::Cycle, cycler::Cycler, palette::Attributes)
# check if none of the cycled attributes of this plot
# were passed manually, because we don't use the cycler
Expand Down

0 comments on commit 71c52fd

Please sign in to comment.