This function provides a custom color scale for ggplot2 plots based on the guidelines set by the American Marketing Association.

ama_scale_color(
  use_color = FALSE,
  palette_name = "OkabeIto",
  grayscale_limits = c(0.2, 0.8)
)

Arguments

use_color

Logical. If TRUE, uses color, otherwise uses grayscale.

palette_name

Character. Name of the color palette to use.

grayscale_limits

Numeric vector. Limits for the grayscale gradient.

Value

A color scale for a ggplot2 plot.

Examples

if (FALSE) {
library(ggplot2)
ggplot(mtcars, aes(mpg, wt, color = gear)) + geom_point(size = 4) + ama_scale_color()
}