colourName {roloc}R Documentation

Convert a colour specification to a colour name

Description

Return a colour name from a colour specification.

Usage

## S3 method for class 'colourMatch'
colourNames(x,
                             ...)
## Default S3 method:
colourNames(x,
                             colourList=getOption("roloc.colourList"),
                             colourMetric=getOption("roloc.colourMetric"),
                             ...)
colourName(...)

Arguments

x

A "colourMatch" object or an R colour specification

colourList

A list of colours

colourMetric

A colour metric function. See colourMatch for details.

...

For colourNames, arguments passed to the colour metric function. For colourName, arguments passed to colourNames

Value

colourNames returns a list of colour names (possibly more than one per colour specification). colourName returns a vector of colour names (only the first match per colour specification).

Author(s)

Paul Murrell

Examples

# Some colours() are identical to each other
newColours <- colourName(rgb(t(col2rgb(colours())), maxColorValue=255))
repeats <- newColours != colours()
cbind(colours()[repeats], newColours[repeats])

[Package roloc version 0.1-2 Index]