spec2rgb: Spectrum to rgb colour conversion

View source: R/spec2rgb.R

spec2rgbR Documentation

Spectrum to rgb colour conversion

Description

Calculates rgb values from spectra based on human colour matching functions.

Usage

spec2rgb(rspecdata, alpha = 1)

Arguments

rspecdata

(required) a data frame, possibly of class rspec, which contains a column containing a wavelength range, named 'wl', and spectra data in remaining columns.

alpha

alpha value to use for colours (defaults to 1, opaque).

Value

A character vector consisting of hexadecimal colour values for passing to further plotting functions.

Author(s)

Hugo Gruson hugo.gruson+R@normalesup.org

Chad Eliason cme16@zips.uakron.edu

References

CIE(1932). Commission Internationale de l'Eclairage Proceedings, 1931. Cambridge: Cambridge University Press.

Examples

data(teal)
spec2rgb(teal)

# Plot data using estimated perceived colour
plot(teal, col = spec2rgb(teal), type = "overlay")

pavo documentation built on Sept. 24, 2023, 5:06 p.m.