createVis: Create Visible Spectrum

Description Usage Arguments Value

View source: R/createVis.R

Description

Convets a vector of visible wavelengths to their approximate RGB values with an option to adjust the transparency of the colors to the relative intensity of the emission at each wavelength. The code is modified from https://gist.github.com/friendly/67a7df339aa999e2bcfcfec88311abfc.

Usage

1
createVis(wavelength, intensity, adj_intensity, gamma = 1)

Arguments

wavelength

Vector of visible wavelengths, in nm, to convert to RGB values. Limited to wavelengths between 380 nm and 750 nm. Wavelengths outside of this range have an RGB value of #000000, which corresponds to the color black.

intensity

Vector of intensities of wavelengths.

adj_intensity

Logical value that determines whether the transparency of an emission line is scaled to the emission line's relative intensity. Defaults to TRUE.

gamma

Correction for a non-linear response to RGB values.

Value

vector of RGB values


dtharvey/atomicEmission documentation built on July 11, 2021, 2 p.m.