testCol {PBSmodelling}R Documentation

Display Named Colours Available Based on a Set of Strings

Description

Display colours as patches in a plot. Useful for programming purposes. Colours can be specified in any of 3 different ways: (i) by colour name, (ii) by hexidecimal colour code created by rgb(), or (iii) by an index to the color() palette.

Usage

testCol(cnam=colors()[sample(length(colors()),15)])

Arguments

cnam vector of colour names to display. Defaults to 15 random names from the color palette.

Author(s)

Rowan Haigh, Pacific Biological Station, Nanaimo BC

See Also

pickCol

Examples

testCol(c("sky","fire","sea","wood"))

testCol(c("plum","tomato","olive","peach","honeydew"))

testCol(substring(rainbow(63),1,7))

#display all colours set in the colour palette
testCol(1:length(palette()))

#they can even be mixed
testCol(c("#9e7ad3", "purple", 6))

[Package PBSmodelling version 2.55.175 Index]