colorSpec is an R package providing an S3 class with methods for color spectra. It supports the standard calculations with spectral properties of light sources, materials, cameras, eyes, scanners, etc. And it works well with the more general action spectra.
When a spectrum is contructed, a quantity
is required, though it can be changed after contruction. The colorSpec quantities are typically not the same as the SI quantities; they are more general. There are 14 quantities, which then defined the 4 basic spectrum types
, as given in this table from the User Guide.
colorSpec |
quantity |
metric |
comments |
examples |
---|---|---|---|---|
light |
energy |
radiometric |
radiometric quantities are conventional in colorimetry |
D65.1nm |
photons |
actinometric |
for color calculations, actinometric units are automatically converted to radiometric |
F96T12 Airam-GR8E.txt |
|
responsivity |
energy->electrical |
radiometric |
RGB camera response |
Flea2.RGB |
energy->neural |
eye response |
xyz1931.1nm |
||
energy->action |
examples are erythemal action, melatonin suppression, etc. |
erythemalSpectrum() |
||
photons->electrical |
actinometric |
silicon sensors usually use quantum efficiency as measure of responsivity |
Zyla_sCMOS.txt |
|
photons->neural |
response units might be photocurrent, or spikes/sec, etc. |
HigherPasserines | ||
photons->action |
photosynthesis is an example |
BeanPhotosynthesis.txt |
||
material |
reflectance |
NA |
this is the diffuse reflectance |
CC_Avg20_spectrum_XYY.txt |
transmittance |
NA |
for color calculations, absorbance is automatically converted to transmittance |
Hoya |
|
responsivity |
material->electrical |
NA |
a spectrum of this type typically comes from both a light source and a camera |
scanner.ACES (a standard for scanning film) |
Table 2.1. The types of spectra and their quantities
The quantity
is used to label plots, and to make sense out of the arguments in the function product()
.
invert()
implements a method in
Davis G (2019). “A Centroid for Sections of a Cube in a Function Space, with application to Colorimetry.” ArXiv e-prints. 1811.00990, https://arxiv.org/abs/1811.00990.