Learn R Programming

munsellinterpol (version 3.0-0)

HVCfromMunsellName: Convert Munsell Notation to numerical Munsell HVC

Description

Convert Munsell Notation to numerical Munsell HVC

Usage

HVCfromMunsellName( MunsellName )
MunsellHVC( MunsellName )
HueNumberFromString( HueString )

Arguments

MunsellName

a character vector of length N > 0, where each string should be a valid Munsell notation, e.g. '2.3P 5/2.3', '9.2YR 3/6', 'N 2.3/', and 'N 4/0'. Whitespace is optional and ignored. It is OK for a neutral to end in either '/' or '/0'.

HueString

a character vector of length N > 0, where each string should be the initial hue part of a Munsell notation, e.g. '4.5GY', '2.5R', '10.3B', etc. Whitespace is optional and ignored. Neutrals, denoted by 'N', are invalid because the hue is undefined.

Value

HVCfromMunsellName() returns a numeric Nx3 matrix with HVC in the rows. For neutral colors, both H and C are set to 0. If a string cannot be parsed, the entire row is set to NAs. The rownames are set to MunsellName.

MunsellHVC() returns a character Nx3 matrix with HVC in the rows, and is there for backward compatibility with older versions of the package. For neutral colors, H is set to 'N' and C is set to '0'.

HueNumberFromString() returns the hue number H (in (0,100]). If the string cannot be parsed, or the color is neutral, the output is set to NA.

For all functions the Hue Number is wrapped to (0,100].

References

Nimeroff, I. Colorimetry. National Bureau of Standards Monograph 104. January 1968. 35 cents.

ASTM D 1535-80. Standard Practice for Specifying Color by the Munsell System. 1980.

Munsell Book of Color: defining, explaining, and illustrating the fundamental characteristics of color. Munsell Color Co. 1929.

Atlas of the Munsell Color System. Malden, Mass., Wadsworth, Howland & Co., inc., Printers. 1915.

See Also

MunsellNameFromHVC(), HueStringFromNumber()

Examples

Run this code
# NOT RUN {
HVCfromMunsellName( c( "4.2P 2.9/3.8", "N 2.3/", "N 8.9/0" ) )
##                  H   V   C
##  4.2P 2.9/3.8 84.2 2.9 3.8
##  N 2.3/        0.0 2.3 0.0
##  N 8.9/0       0.0 8.9 0.0

HueNumberFromString( c('4B','4.6GY','10RP','N') )
##  [1]  64.0  34.6 100.0    NA
# }

Run the code above in your browser using DataLab