Calculates rgb values from spectra based on human color matching functions (CMF) or chromaticity coordinates (CC). A CMF takes into account luminous sensitivity, while a CC only the color hue. This function, in contrast to that in package pavo does not normalize the values to equal luminosity, so using a CMF as input gives the expected result. Another difference is that it allows the user to choose the chromaticity data to be used. The data used by default is different, and it corresponds to the whole range of CIE standard, rather than the reduced range 400 nm to 700 nm. The wavelength limits are not hard coded, so the function could be used to simulate vision in other organisms as long as pseudo CMF or CC data are available for the simulation.
numeric vector of wavelengths (nm).
numeric vector of spectral irradiance values.
a chroma_spct object with variables w.length, x, y, and z, giving the CC or CMF definition (default is the proposed human CMF according to CIE 2006.).
character string for naming the rgb color definition.
logical indicating whether to check or not spectral data.
A color defined using
rgb. The numeric
values of the RGB components can be obtained using function
Very heavily modified from Chad Eliason's
[email protected] spec2rgb function in package
CIE(1932). Commission Internationale de l'Eclairage Proceedings, 1931. Cambridge: Cambridge University Press.
Color matching functions obtained from Colour and Vision Research Laboratory online data repository at http://www.cvrl.org/.
Other low-level functions operating on numeric vectors.:
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.