compare: Color Difference

View source: R/compare.R

compareR Documentation

Color Difference

Description

Computes CIELAB distance metric.

Usage

compare(x, metric = 2000, diag = FALSE, upper = FALSE)

Arguments

x

A character vector of colors.

metric

An integer value giving the year the metric was recommended by the CIE. It must be one of "1976", "1994", or "2000" (default; see spacesXYZ::DeltaE()).

diag

A logical scalar: should the diagonal of the distance matrix be printed?

upper

A logical scalar: should the upper triangle of the distance matrix should be printed?

Value

A distance matrix.

Author(s)

N. Frerebeau

See Also

Other diagnostic tools: convert(), plot.color_scheme(), plot_map(), plot_scheme_colourblind(), plot_scheme(), plot_tiles()

Examples

# Trichromat
pal <- colour("bright")

(deltaE <- compare(pal(5)))
summary(deltaE)

# Deuteranopia
deu <- convert(pal, mode = "deuteranopia")
compare(deu(5))

# Protanopia
pro <- convert(pal, mode = "protanopia")
compare(pro(5))

# Tritanopia
tri <- convert(pal, mode = "tritanopia")
compare(tri(5))

# Achromatopsia
ach <- convert(pal, mode = "achromatopsia")
compare(ach(5))

tesselle/khroma documentation built on Jan. 15, 2024, 9:15 p.m.