Learn R Programming

aqp (version 1.18)

colorContrast: Metrics of Contrast Suitable for Comparing Soil Colors

Description

Pair-wise comparisons of Munsell color specifications, based on the NCSS color contrast classes and CIE delta-E 2000 metric.

Usage

colorContrast(m1, m2)

Arguments

m1

vector of Munsell colors ('10YR 3/3')

m2

vector of Munsell colors ('10YR 3/6')

Value

A data.frame with the following columns:

m1

Munsell color 1

m2

Munsell color 2

dH

delta-hue, as computed by huePosition

dV

delta-value, absolute value of difference in Munsell value (m1 vs. m2)

dc

delta-chroma, absolute value of difference in Munsell chroma (m1 vs. m2)

dE00

delta-E00, e.g. the CIE delta-E as refined in 2000

c

soil color contrast class, as specified in Soil Survey Technical Note 2

Details

This function is fully vectorized but expects input to be of the same length. Use expand.grid to generate suitable input from 1:many or many:1 type comparisons. See this tutorial for an expanded discussion and more examples.

References

https://en.wikipedia.org/wiki/Color_difference

See Also

colorContrastPlot, huePosition

Examples

Run this code
# NOT RUN {
# two sets of colors to compare
m1 <- c('10YR 6/3', '7.5YR 3/3', '10YR 2/2', '7.5YR 3/4')
m2 <- c('5YR 3/4', '7.5YR 4/4', '2.5YR 2/2', '7.5YR 6/3')

# contrast metrics
colorContrast(m1, m2)

# }

Run the code above in your browser using DataLab