R/pal-grey.r

Defines functions grey_pal

Documented in grey_pal

#' Grey scale palette (discrete)
#'
#' @param start grey value at low end of palette
#' @param end grey value at high end of palette
#' @seealso [seq_gradient_pal()] for continuous version
#' @export
#' @examples
#' show_col(grey_pal()(25))
#' show_col(grey_pal(0, 1)(25))
grey_pal <- function(start = 0.2, end = 0.8) {
  force_all(start, end)
  function(n) grDevices::grey.colors(n, start = start, end = end)
}

Try the scales package in your browser

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

scales documentation built on Aug. 20, 2022, 1:05 a.m.