Skip to content

Commit

Permalink
Even more protections against 3.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 19, 2024
1 parent 27172b7 commit 7444c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/palette-registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
#' @examples
#' # Get one of the known palettes
#' get_palette("Okabe-Ito")
#' get_palette("hue")
#'
#' # Set a new custom palette
#' cols <- c("palegreen", "deepskyblue", "magenta")
Expand Down Expand Up @@ -116,9 +116,10 @@ register_base_pals <- function() {
if (getRversion() < "4.0.0") {
return(invisible(NULL))
}
names <- grDevices::palette.pals()
names <- getFromNamespace("palette.pals", "grDevices")()
palette <- getFromNamespace("palette.colors", "grDevices")
for (name in names) {
fun <- manual_pal(grDevices::palette.colors(palette = name), type = "colour")
fun <- manual_pal(palette(palette = name), type = "colour")
set_palette(name, fun, warn_conflict = FALSE)
}
invisible(NULL)
Expand Down Expand Up @@ -154,4 +155,3 @@ register_dichromat_pals <- function() {
}
invisible(NULL)
}

2 changes: 1 addition & 1 deletion man/get_palette.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7444c92

Please sign in to comment.