Learn R Programming

vangogh (version 0.1.3)

get_cvd_safe_palettes: Get CVD-Safe Van Gogh Palettes

Description

Returns a list of Van Gogh palettes that meet minimum accessibility standards for color vision deficiency.

Usage

get_cvd_safe_palettes(
  min_distance = 15,
  cvd_types = c("deutan", "protan", "tritan")
)

Value

Character vector of palette names that meet the criteria

Arguments

min_distance

Numeric. Minimum CIELAB distance threshold. Default 15.

cvd_types

Character vector. Which CVD types to check. Options: "deutan", "protan", "tritan". Default checks all.

Examples

Run this code
if (FALSE) {
# Get highly accessible palettes
safe_palettes <- get_cvd_safe_palettes(min_distance = 20)

# Use a safe palette
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point() +
  scale_color_vangogh(safe_palettes[1])
}

Run the code above in your browser using DataLab