Shows how a color palette appears to individuals with different types
of color vision deficiency using physiologically accurate models from farver.
Usage
simulate_palette_cvd(
colors,
cvd_type = c("all", "protan", "deutan", "tritan"),
severity = 1,
plot = FALSE
)Value
If cvd_type is "all", returns a list with simulated palettes for
each type (and original). Otherwise returns a character vector of simulated hex colors.
The output object also inherits from huerd_simulation_result.
Examples
palette_ex <- generate_palette(6, progress = FALSE)
# Simulate complete deuteranopia
deutan_palette <- simulate_palette_cvd(palette_ex, "deutan", severity = 1.0)
print(deutan_palette)
#>
#> -- huerd CVD Simulation Result (Type: deutan, Severity: 1.00) --
#> [ 1] #3B3300
#> [ 2] #0049FC
#> [ 3] #587CC4
#> [ 4] #A39000
#> [ 5] #8696C0
#> [ 6] #C5C7CD
# See all CVD types and plot them
if (interactive() && length(palette_ex) > 0) {
all_cvd <- simulate_palette_cvd(palette_ex, "all", plot = TRUE)
}
