color: Color of an object

Description Usage Arguments Methods (by class) Note Examples

View source: R/waveband.class.R

Description

A function that returns the equivalent RGB color of an object such as a spectrum or wavelength.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
color(x, ...)

## Default S3 method:
color(x, ...)

## S3 method for class 'numeric'
color(x, type = "CMF", ...)

## S3 method for class 'list'
color(x, short.names = TRUE, type = "CMF", ...)

## S3 method for class 'waveband'
color(x, short.names = TRUE, type = "CMF", ...)

## S3 method for class 'source_spct'
color(x, type = "CMF", ...)

## S3 method for class 'source_mspct'
color(x, ..., idx = !is.null(names(x)))

Arguments

x

an R object

...

not used in current version

type

character telling whether "CMF", "CC", or "both" should be returned.

short.names

logical indicating whether to use short or long names for wavebands

idx

logical whether to add a column with the names of the elements of spct

Methods (by class)

Note

When x is a list but not a waveband, if a method color is not available for the class of each element of the list, then color.default will be called.

Examples

1
2
3
4
5
6
7
8
wavelengths <- c(300, 420, 500, 600, NA) # nanometres
color(wavelengths)
color(waveband(c(300,400)))
color(list(blue = waveband(c(400,480)), red = waveband(c(600,700))))
color(numeric())
color(NA_real_)

color(sun.spct)

photobiology documentation built on May 19, 2017, 9:54 p.m.

Search within the photobiology package
Search all R packages, documentation and source code