This plot simulates a page from the Munsell Book of Color. The colors are best viewed on a display calibrated for the RGB space given as the second argument.
plotPatchesH( hue, space='sRGB', adapt='Bradford', background='gray50',
main="Hue %s (H=%g) [%s adapt=%s]", ... )
a Munsell hue for which the plot is created.
It is automatically wrapped to the interval (0,100].
It does not have to be a multiple of 2.5.
hue
can also be a numeric vector of such numbers,
and then a separate plot is made for each element of the vector.
hue
can also be a character vector of Hue Names,
which is then converted to a numeric vector using
HueNumberFromString()
.
the name of an installed RGB space.
Spaces 'sRGB'
and 'AdobeRGB'
are pre-installed,
and others can be installed using spacesRGB::installRGB()
method used to adapt xyY for Illuminant C to xyY for Illuminant D65.
It is passed to MunsellToRGB()
.
background color for the plot.
It is passed to par()
as argument bg
.
a string used to set the main title of the plot.
The optional placeholder '%s'
is replaced by the Hue Name,
'%g'
is replaced by the Hue Number,
the next '%s'
is replaced by space
, and
the last '%s'
is replaced by adapt
.
other arguments passed to the function MunsellToRGB()
.
This includes hcinterp
, vinterp
, and xyC
.
TRUE
for success and FALSE
for failure.
The discrete Values are always the same: integers from 0 to 10.
And so the plotting parameter ylim=c(0,11)
.
The discrete Chromas are contiguous even integers depending on the Hue,
and determined as follows.
For the closest discrete Hue in real.dat
,
the patches in real.dat
are transformed to xyY using simple lookup.
These are then tested against the MacAdam Limits for Illuminant C
using IsWithinMacAdamLimits()
.
The patches outside the limits are discarded,
and the maximum Chroma of the remaining patches,
which is always an even integer, determines xlim
.
Patches inside the MacAdam Limits can still be outside the RGB cube. Patches inside the cube are drawn in the usual way, and those outside are drawn in outline only, and with the clamped RGB coordinates printed inside.
MunsellToRGB()
,
HueNumberFromString()
,
IsWithinMacAdamLimits()
,
spacesRGB::installRGB()