This returns the distance, according to the method, between corresponding hex-colors in hex and hex_ref.

pev_hex_distance(hex, hex_ref, method = "cie2000")

Arguments

hex

character vector of hex-colors

hex_ref

character vector of hex-colors

method

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

Value

numerical vector, same length as hex and hex_ref.

Details

The vectors hex and hex_ref must be the same length.

Examples

pev_hex_distance("#000000", "#FFFFFF")
#> [1] 100
pev_hex_distance(c("#000000", "#FFFFFF"), c("#000000", "#000000"))
#> [1] 0 100
pev_hex_distance(c("#000000", "#FFFFFF"), "#000000")
#> [1] 0 100