wav2RGB: Converts light wavelengths to RGB colors

View source: R/wav2RGB.R

wav2RGBR Documentation

Converts light wavelengths to RGB colors

Description

Converts wavelengths in nanometers into corresponding visible colors.

Usage

  wav2RGB(wav)

Arguments

wav

Numeric vector of wavelengths (in nanometers) to convert into colors.

Value

Returns a character vector of the same length as wav, with an RGB color for each wavelength. Wavelengths out of visible ranges return black.

Author(s)

Sylvain Mareschal

References

http://codingmess.blogspot.fr/2009/05/conversion-of-wavelength-in-nanometers.html

Examples

  wv <- seq(from=300, to=800, by=10)
  plot(x=wv, y=rep(1, length(wv)), col=wav2RGB(wv), pch=19)

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.