Learn R Programming

munsellinterpol (version 3.5-1)

HVCfromMunsellName: Convert Munsell Notation to numerical Munsell HVC

Description

Convert Munsell Notation to numerical Munsell HVC

Usage

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

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.

HueNumberFromString() returns the hue number H. If the string cannot be parsed, the output is set to NA.

For the 2 previous functions the Hue Number is wrapped to (0,100], except when Chroma==0 and then Hue=0.

MunsellHVC()

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

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.

Condition Signaling

For an overview see: Appendix E - Logging and Condition Signaling in the User Guide.

In case of an ERROR event, an error condition is signaled with the additional S3 class "invalid_argument". The invalid argument is added to the condition object.

In the case that not all HVC rows, or Hue numbers, could be computed, because some of the strings are invalid, a warning condition is signaled with the additional S3 class "incomplete". The condition object also has the subvector of invalid strings as item invalid, and their indexes as item indexes.

Author

Glenn Davis

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
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