pev_hex_distance: Calculate perceptual-distance between two (sets of) colors

Description Usage Arguments Details Value Examples

View source: R/hex-distance.R

Description

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

Usage

1
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".

Details

The vectors hex and hex_ref must be the same length.

Value

numerical vector, same length as hex and hex_ref.

Examples

1
2
3
  pev_hex_distance("#000000", "#FFFFFF")
  pev_hex_distance(c("#000000", "#FFFFFF"), c("#000000", "#000000"))
  pev_hex_distance(c("#000000", "#FFFFFF"), "#000000")

ijlyttle/paleval documentation built on Dec. 25, 2019, 9:17 a.m.