You can evaluate distance for categorial palettes (_cat
functions), or for
quantitative functions (_qnt
functions). You can evaluate using Euclidean
distance in a color space (_euclid
functions), or using a metric
(_metric
functions).
pth_data_cat_euclid(color, ...)
# S3 method for default
pth_data_cat_euclid(color, ...)
# S3 method for character
pth_data_cat_euclid(
color,
cvd = pth_cvd_grid_severity(),
transformer = NULL,
non_luminance_weight = 1,
...
)
# S3 method for pth_hex
pth_data_cat_euclid(
color,
cvd = pth_cvd_grid_severity(),
transformer = NULL,
non_luminance_weight = 1,
...
)
# S3 method for pth_mat
pth_data_cat_euclid(
color,
cvd = pth_cvd_grid_severity(),
transformer = NULL,
non_luminance_weight = 1,
...
)
pth_data_cat_metric(color, ...)
# S3 method for default
pth_data_cat_metric(color, ...)
# S3 method for character
pth_data_cat_metric(
color,
cvd = pth_cvd_grid_severity(),
method = c("cie2000", "cie94", "cie1976", "cmc"),
...
)
# S3 method for pth_hex
pth_data_cat_metric(
color,
cvd = pth_cvd_grid_severity(),
method = c("cie2000", "cie94", "cie1976", "cmc"),
...
)
# S3 method for pth_mat
pth_data_cat_metric(
color,
cvd = pth_cvd_grid_severity(),
method = c("cie2000", "cie94", "cie1976", "cmc"),
...
)
pth_data_qnt_euclid(palette, ...)
# S3 method for default
pth_data_qnt_euclid(palette, ...)
# S3 method for pth_palette
pth_data_qnt_euclid(
palette,
n_step = 12,
cvd = pth_cvd_grid_severity(),
transformer = NULL,
non_luminance_weight = 1,
...
)
pth_data_qnt_metric(palette, ...)
# S3 method for default
pth_data_qnt_metric(palette, ...)
# S3 method for pth_palette
pth_data_qnt_metric(
palette,
n_step = 12,
cvd = pth_cvd_grid_severity(),
method = c("cie2000", "cie94", "cie1976", "cmc"),
...
)
Object that can be coerced into colors,
i.e. pth_hex
or pth_mat
. Used for categorical palettes.
additional arguments passed on to transformer
.
tbl_df
with columns condition
, severity
;
see pth_cvd_grid()
.
function
used to transform the colors to new
color space, e.g. pth_to_cieluv.
numeric
used to "discount" the effects of
chroma and hue in the distance calculation.
character
metric used by farver::compare_colour()
.
function
with S3 class pth_palette
. Used for quantitative
palettes.
Object coerced to integer
, number of steps to take along
palette
, 0 <= x <= 1
.
tbl_df
with columns:
character
hex-code of original color.
character
hex-code of original color.
character
type of color-vision deficiency.
numeric
indicates severity using scale 0-1.
character
hex-code of color under CVD.
character
hex-code of color under CVD.
numeric
perceptual distance between colors
Each row describes an interaction between two colors in a palette.
For a categorical palette (_cat
functions), each color in the palette is
compared with all the colors in the palette; for n
colors, a tibble
with n^2
rows is returned.
For a quantitative palette (_qnt
functions), the palette is discretized;
each color is compared with its neighbors. A data frame with n_step
rows is
returned.