is_colour: Is an object a valid colour?

Description Usage Arguments Details Author(s) Examples

View source: R/is_colour.R

Description

Check an object to see if it is a valid colour or set of colours.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
is_colour(x)

## S3 method for class 'character'
is_colour(x)

## S3 method for class 'numeric'
is_colour(x)

## S3 method for class 'logical'
is_colour(x)

## S3 method for class 'factor'
is_colour(x)

Arguments

x

object to be tested.

Details

Colours in R can be represented by names (colours), index number (palette) or a hexidecimal character.

Author(s)

Ciaran Tobin

Examples

1
2
3
4
is_colour('#ffffff')
is_colour('white')
is_colour('periwinkle blue')
is_colour(4L)

cttobin/ggthemr documentation built on April 18, 2018, 11:36 p.m.