Learn R Programming

colorblindcheck (version 1.0.4)

palette_check: Compare Palette with Color Vision Deficiencies

Description

Comparision of the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia.

Usage

palette_check(
  x,
  tolerance = NULL,
  plot = FALSE,
  bivariate = FALSE,
  severity = 1,
  ...
)

Value

A data.frame with 4 observations and 8 variables:

  • name: orginal input color palette (normal), deuteranopia, protanopia, and tritanopia

  • n: number of colors

  • tolerance: minimal value of acceptable difference between the colors to distinguish between them

  • ncp: number of color pairs

  • ndcp: number of differentiable color pairs (color pairs with distances above the tolerance value)

  • min_dist: minimal distance between colors

  • mean_dist: average distance between colors

  • max_dist: maximal distance between colors

Additionally, a plot comparing the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia can be shown.

Arguments

x

A vector of hexadecimal color descriptions

tolerance

The minimal value of acceptable difference between the colors to distinguish between them. As the default, minimal distance between colors in the original input palette is given.

plot

If TRUE, display a plot comparing the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia

bivariate

If TRUE (and plot = TRUE), display a bivariate plot (plot where colors are located in columns and rows) comparing the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia

severity

Severity of the color vision defect, a number between 0 and 1

...

Other arguments passed on to palette_dist() to control the color metric

Examples

Run this code
rainbow_pal = rainbow(n = 7)
rainbow_pal
palette_check(rainbow_pal, plot = TRUE)

x = rcartocolor::carto_pal(11, "Vivid")
palette_check(x)
palette_check(x, plot = TRUE)
palette_check(x, tolerance = 1)
palette_check(x, tolerance = 10, metric = 1976)
palette_check(x, plot = TRUE, severity = 0.5)

y = rcartocolor::carto_pal(4, "Sunset")
palette_check(y, plot = TRUE, bivariate = TRUE, severity = 0.5)

Run the code above in your browser using DataLab