An approximation, for now.

pev_data_hcl_ref(.fpal, hex_ref, n = NULL, method = "cie2000",
  include_cvd = TRUE, ...)

# S3 method for default
pev_data_hcl_ref(.fpal, hex_ref, n = NULL,
  method = "cie2000", include_cvd = TRUE, ...)

# S3 method for character
pev_data_hcl_ref(.fpal, hex_ref, n = NULL,
  method = "cie2000", include_cvd = TRUE, ...)

# S3 method for pev_fcont
pev_data_hcl_ref(.fpal, hex_ref, n = NULL,
  method = "cie2000", include_cvd = TRUE, ...)

# S3 method for pev_funbounded
pev_data_hcl_ref(.fpal, hex_ref, n = NULL,
  method = "cie2000", include_cvd = TRUE, ...)

# S3 method for pev_fbounded
pev_data_hcl_ref(.fpal, hex_ref, n = NULL,
  method = "cie2000", include_cvd = TRUE, ...)

Arguments

.fpal

palette-function.

hex_ref

character vector of hex-colors

n

integer, number of points to discretize the range (0, 1) of the palette-function to determine the minimum perceptual-distance.

method

character method to use for distance calculation, passed to farver::compare_color(). One of: "euclidean", "cie1976", "cie94", "cie2000", or "cmc".

include_cvd

logical or character, indicates to include data for for color-vision deficiency. Possible character values: "none", "protan", "deutan", "tritan".

...

other args (not used)

Value

data.frame with variables cvd, x_nearest, distance_nearest, hex, hex_ref, hue, chroma, luminance.

Examples

pev_data_hcl_ref("Viridis", "#008F97")
#> # A tibble: 4 x 8 #> cvd x_nearest distance_nearest hex_nearest hex_ref hue_ref chroma_ref #> <chr> <dbl> <dbl> <chr> <chr> <dbl> <dbl> #> 1 none 0.547 0.533 #009097 #008F97 201. 43.8 #> 2 deut… 0.547 0.533 #596798 #586798 258. 43.3 #> 3 prot… 0.547 0.533 #788097 #777F97 255. 21.3 #> 4 trit… 0.547 0.533 #009C91 #009B90 181. 45.6 #> # … with 1 more variable: luminance_ref <dbl>