Skip to content

Commit

Permalink
Rework ggdist::ramp_colours for version namespacing issues
Browse files Browse the repository at this point in the history
Ref #397
  • Loading branch information
mitchelloharawild committed Mar 2, 2024
1 parent 6483166 commit 58b4cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ build_fbl_layer <- function(object, data = NULL, level = c(80, 95),
# Apply ramped fill
if (!is.null(data[["fill_ramp"]])) {
if (utils::packageVersion("ggdist") > "3.3.1") {
data$fill <- ggdist::ramp_colours(data$fill, data$fill_ramp)
data$fill <- get("ramp_colours", asNamespace("ggdist"), mode = "function")(data$fill, data$fill_ramp)
} else {
data$fill <- mapply(function(color, amount){
(scales::seq_gradient_pal(attr(amount, "from") %||% "white", color))(amount %||% NA)
Expand Down

0 comments on commit 58b4cc2

Please sign in to comment.