View source: R/analyze_palette.R
analyze_palette | R Documentation |
Analyze a categorical color palette with respect to the differences between the colors in the palette.
analyze_palette(
palette,
cvd = c(protan = 0, deutan = 0, tritan = 0),
bg = NULL,
metric = c("ciede2000", "din99d", "cie76")
)
palette |
Either a matrix of RGB values (with values between 0 and 1), a data frame with RGB values, or a character vector of hex colors. |
cvd |
Color vision deficiency adaptation. This must be a named
vector with names |
bg |
Background color to consider (but not include) when
generating the palette. This is useful to avoid colros that are too
close to the background/canvas color. If |
metric |
The color metric to use for the color distance matrix. |
A list of lists, one for each type of color vision deficiency plus
normal vision. Each list contains difference_matrix
, min_distances
, and
bg_min_distance
qualpal()
pal <- qualpal(5)
analyze_palette(pal$hex, cvd = c(protan = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.