In the spatstat package, an object of class "colourmap"
defines a mapping between data and colours.
The function default.colourmap provides a suitable default
colour map for the values in x.
If x is a factor, default.colourmap(x) is a mapping
from the factor levels to colours.
If x is a logical vector, default.colourmap(x) is a mapping
from the values TRUE and FALSE to colours.
If x is a numeric vector, default.colourmap(x) is a
mapping from numbers in the interval between the minimum and maximum values of
x to colours.
The argument col may provide colour information
in any of the following formats:
A colour map (object of class "colourmap")
A palette function (a function(n) or function(n, ...)
which returns a vector of colour values,
such as rainbow
A vector of integers between 1 and 8 indexing the standard
colour palette
A vector of character strings giving common names of colours
(e.g. "red")
A vector of character strings giving hexadecimal codes for
colours (e.g. produced by rgb
or rainbow)
NULL.