R/scale_colour_ggthemr_d.R

Defines functions scale_colour_ggthemr_d

Documented in scale_colour_ggthemr_d

#' ggthemr colour scale
#'
#' A utility function for applying the currently selected ggthemr palette to a ggplot object
#'
#' @param ... optional parameters to be passed through to \link[ggplot2]{discrete_scale}
#' @examples
#' ggplot(mtcars, aes(mpg, disp, colour = factor(am))) + geom_point() + scale_colour_ggthemr_d()
#'
#' @export

scale_colour_ggthemr_d <- function(...) {
  ggplot2::discrete_scale(
             "colour", "ggthemr",
             discrete_colours(swatch()[-1]),
             ...
           )
}

scale_color_ggthemr_d <- scale_colour_ggthemr_d
cttobin/ggthemr documentation built on April 19, 2022, 3:31 a.m.