# Munsell reference spectra
data("munsell.spectra.wide")
# convert to closest Munsell chip
# sRGB -> Munsell conversion via col2Munsell()
spec2Munsell(munsell.spectra.wide[, '10YR 3/3'])
# attempt several
cols <- c('10YR 6/2', '5YR 5/6', '10B 4/4', '5G 4/4', '2.5Y 8/2', '10YR 3/3', '7.5YR 2.5/2')
# most are exact or very close
z <- do.call(
'rbind',
lapply(cols, function(i) {
spec2Munsell(munsell.spectra.wide[, i])
})
)
# format Munsell notation from pieces
z$m <- sprintf("%s %s/%s", z$hue, z$value, z$chroma)
# compare
colorContrastPlot(
m1 = cols,
m2 = z$m,
labels = c('original', 'spectral\ninterpretation')
)
if (FALSE) {
if(requireNamespace("gower")) {
# mix colors, return spectra, convert to color
cols <- c('10YR 6/2', '5YR 5/6', '10B 4/4')
res <- mixMunsell(cols, keepMixedSpec = TRUE, mixingMethod = 'reference')
# note that they are slightly different
res$mixed
spec2Munsell(res$spec)
}
}
Run the code above in your browser using DataLab