colourName: Convert a colour specification to a colour name

Description Usage Arguments Value Author(s) Examples

View source: R/colourName.R

Description

Return a colour name from a colour specification.

Usage

1
2
3
4
5
6
7
8
9
## 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

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

roloc documentation built on May 1, 2019, 7:06 p.m.