Get perceptual-distance of continuous-palette from reference color

pev_data_distance(.fcont, hex_ref = NULL, n_panel = 40,
  include_cvd = TRUE)

Arguments

.fcont

object that can be coerced to pev_fcont, when called with a numeric vector with values between 0 and 1, returns the corresponding (hex-code) values.

hex_ref

character single hex-colors to act as the reference, default value is the beginning of the range of the continuous-palette, i.e. at x = 0.

n_panel

numeric number of panels into which to discretize the domain (0 to 1) of the continous-palette.

include_cvd

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

Value

data.frame with variables cvd, x, hex, hex_ref, distance

Examples

pev_data_distance("Purple-Green")
#> # A tibble: 164 x 5 #> cvd x hex hex_ref distance #> <chr> <dbl> <chr> <chr> <dbl> #> 1 none 0 #492050 #492050 0 #> 2 none 0.025 #562A5E #492050 3.59 #> 3 none 0.05 #65346D #492050 7.58 #> 4 none 0.075 #733F7C #492050 11.7 #> 5 none 0.1 #82498C #492050 16.0 #> 6 none 0.125 #90529C #492050 20.1 #> 7 none 0.15 #9F5CAB #492050 24.7 #> 8 none 0.175 #AE65BB #492050 29.2 #> 9 none 0.2 #B574C2 #492050 33.5 #> 10 none 0.225 #BD82C9 #492050 38.1 #> # … with 154 more rows