R/view_all_palettes.R

Defines functions view_all_palettes

Documented in view_all_palettes

#' Prints all available colour palettes
#'
#' @examples
#' view_all_palettes()
#' @return A plot of all colour palettes available in the package.
#' @export
view_all_palettes <- function() {
  oldpar <- graphics::par(no.readonly = TRUE)
  on.exit(graphics::par(oldpar))
  to_print <- RSSPalettes
  n_all <- length(to_print)
  n_col <- min(4, floor(sqrt(n_all)))
  n_row <- ceiling(n_all / n_col)
  graphics::par(mfrow = c(n_row, n_col))
  purrr::map(.x = names(to_print), .f = ~ print(RSScols(.x)))
}

Try the RSSthemes package in your browser

Any scripts or data that you put into this service are public.

RSSthemes documentation built on Aug. 30, 2023, 1:09 a.m.