Learn R Programming

shades (version 1.4.0)

distance: Colour distance

Description

This function calculates a distance measure that aims to quantify the perceptual difference between a vector of colours and a reference colour. The measure in question is the CIE Delta E (2000), which is calculated based on colour coordinates in Lab space.

Usage

distance(shades, reference)

Arguments

shades

One or more colours, in any suitable form (see shade).

reference

A single reference colour.

Value

A numeric vector of distances.

References

http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html

Examples

Run this code
# NOT RUN {
distance(c("red","green","blue"), "red")
# }

Run the code above in your browser using DataLab