Equivalent RGB color of an object such as a spectrum, wavelength or waveband.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
color_of(x, ...) ## Default S3 method: color_of(x, ...) ## S3 method for class 'numeric' color_of(x, type = "CMF", chroma.type = type, ...) ## S3 method for class 'list' color_of(x, short.names = TRUE, type = "CMF", chroma.type = type, ...) ## S3 method for class 'waveband' color_of(x, short.names = TRUE, type = "CMF", chroma.type = type, ...) ## S3 method for class 'source_spct' color_of(x, type = "CMF", chroma.type = type, ...) ## S3 method for class 'source_mspct' color_of(x, ..., idx = "spct.idx") colour_of(x, ...) color(x, ...) fast_color_of_wl(x, type = "CMF", ...) fast_color_of_wb(x, type = "CMF", ...)
an R object.
ignored (possibly used by derived methods).
character telling whether "CMF", "CC", or "both" should be returned
for human vision, or an object of class
logical indicating whether to use short or long names for wavebands
character Name of the column with the names of the members of the collection of spectra.
A color definition in hexadecimal format as a
of 7 characters, "#" followed by the red, blue, and green values in
hexadecimal (scaled to 0 ... 255). In the case of the specialization for
list, a list of such definitions is returned. In the case of a
collection of spectra, a
data.frame with one column with such
definitions and by default an additional column with names of the spectra
as index. In case of missing input the returned value is
default: Default method (returns always "black").
numeric: Method that returns Color definitions corresponding to
numeric values representing a wavelengths in nm.
list: Method that returns Color of elements in a list.
waveband: Color at midpoint of a
Use of color() is deprecated as this wrapper function may be removed in future versions of the package because of name clashes. Use color_of() instead.
x is a list but not a waveband, if a method
is not available for the class of each element of the list, then
color_of.default will be called.
fast_color_of_wl() should be used only when high
performance is needed. It speeds up performance by rounding the wavelength
values in the numeric vector passed as argument to
x and then
retrieves the corresponding pre-computed color definitions if
"CC". In other cases it falls-back to
color_of.numeric(). Returned color definitions always have
default names irrespective of names of
x, which is different from
the behavior of
fast_color_of_wb() accepts waveband objects and lists of
waveband objects. If all wavebands are narrow, it issues a vectotized
fast_color_of_wl() with a vector of waveband midpoint
1 2 3 4 5 6 7 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.