Split Munsell color notation into "hue", "value", and "chroma", with optional conversion to sRGB hex notation, sRGB coordinates, and CIELAB coordinates. Conversion is performed by munsell2rgb.

parseMunsell(munsellColor, convertColors = TRUE, delim = NA, ...)

Arguments

munsellColor

character vector of Munsell colors (e.g. c('10YR 3/4', '5YR 4/6'))

convertColors

logical, convert colors to sRGB hex notation, sRGB coordinates, CIELAB coordinates

delim

optional, specify the type of delimiter used between value and chroma parts of the Munsell code. By default ":", ",:, "'", and "/" are supported.

...

additional arguments to munsell2rgb

Value

a data.frame object

Author

P. Roudier and D.E. Beaudette

Examples


# just sRGB
parseMunsell("10YR 3/5", return_triplets = TRUE)
#>           r         g          b
#> 1 0.3755239 0.2554937 0.09112035

# sRGB + CIELAB (D65 illuminant)
parseMunsell("10YR 3/5", return_triplets = TRUE, returnLAB = TRUE)
#>           r         g          b        L        A        B
#> 1 0.3755239 0.2554937 0.09112035 30.27982 8.897842 29.92632

# CIELAB only
parseMunsell("10YR 3/5", return_triplets = FALSE, returnLAB = TRUE)
#>          L        A        B
#> 1 30.27982 8.897842 29.92632

# neutral hue
# note chroma encoded as '0'
parseMunsell('N 3/', convertColors = FALSE)
#>   hue value chroma
#> 1   N     3      0