View source: R/validateMunsell.R
| validateMunsell | R Documentation |
This function validates Munsell color notation according to the following requirements:
hue must not be absent, and within the set of "standard hues", see huePosition()
value must not be absent, and within vRange
chroma must be within cRange, and is only allowed to be absent in neutral colors (e.g. N 4/)
validateMunsell(m, vRange = c(1, 10), cRange = c(0, 50))
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 |
logical vector,
TRUE: valid Munsell notation
FALSE: invalid notation
huePosition()
# 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'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.