colorSpec

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
type

quantity

metric

comments

examples
(objects, files, functions)

light

energy

radiometric

radiometric quantities are conventional in colorimetry

D65.1nm
pos1-20x.scope
BlueFlame.txt

photons

actinometric

for color calculations, actinometric units are automatically converted to radiometric

F96T12
Airam-GR8E.txt

responsivity
.light

energy->electrical

radiometric

RGB camera response

Flea2.RGB
Red-Epic-Dragon.txt

energy->neural

eye response

xyz1931.1nm
luminsivity.1nm
Osmia-rufa.txt

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
FoveonX3.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
absorbance

NA

for color calculations, absorbance is automatically converted to transmittance

Hoya
Hematoxylin.txt
atmosphere2003

responsivity
.material

material->electrical
material->neural
material->action

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().



The function 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.