plot_scheme_colourblind: Plot Simulated Color Blindness

View source: R/plot_scheme_colorblind.R

plot_scheme_colourblindR Documentation

Plot Simulated Color Blindness

Description

Shows colors in a plot with different types of simulated color blindness.

Usage

plot_scheme_colourblind(x)

plot_scheme_colorblind(x)

Arguments

x

A character vector of colors.

Value

plot_scheme_colourblind() is called for its side-effects: it results in a graphic being displayed (invisibly returns x).

Author(s)

N. Frerebeau, V. Arel-Bundock

See Also

Other diagnostic tools: change(), compare(), plot.color_scheme(), plot_map(), plot_scheme(), plot_tiles()

Examples

if (requireNamespace("spacesXYZ", quietly = TRUE)) {
  ## Trichromat
  pal <- colour("bright")
  plot_scheme(pal(7))

  ## Deuteranopia
  deu <- change(pal, mode = "deuteranopia")
  plot_scheme(deu(7))

  ## Protanopia
  pro <- change(pal, mode = "protanopia")
  plot_scheme(pro(7))

  ## Tritanopia
  tri <- change(pal, mode = "tritanopia")
  plot_scheme(tri(7))

  ## Achromatopsia
  ach <- change(pal, mode = "achromatopsia")
  plot_scheme(ach(7))

  ## Plot simulated color blindness
  plot_scheme_colorblind(pal(7))
}

khroma documentation built on April 4, 2025, 2:37 a.m.