Learn R Programming

aqp (version 2.3.1)

validateMunsell: Validate Standard Munsell Notation

Description

This function validates Munsell color notation according to the following requirements:

  1. hue must not be absent, and within the set of "standard hues", see huePosition()

  2. value must not be absent, and within vRange

  3. chroma must be within cRange, and is only allowed to be absent in neutral colors (e.g. N 4/)

Usage

validateMunsell(m, vRange = c(1, 12), cRange = c(0, 50))

Value

logical vector,

  • TRUE: valid Munsell notation

  • FALSE: invalid notation

Arguments

m

character vector of colors in Munsell notation

vRange

numeric vector of length 2, range of expected Munsell value

cRange

numeric vector of length 2, range of expected Munsell chroma

See Also

huePosition()

Examples

Run this code

# valid
validateMunsell('5Y 6/8')
validateMunsell('N 4/')
validateMunsell('2.5Y 4/0')

# invalid
validateMunsell('5G 0/4')
validateMunsell(NA)

# mixture
validateMunsell(c('5G 4/4', 'N 2/', NA, 'NA', '100R 3/3'))

Run the code above in your browser using DataLab