check_colour_return_rgb: Checks colour variables are either RGB values, hex colour...

View source: R/helper_functions.R

check_colour_return_rgbR Documentation

Checks colour variables are either RGB values, hex colour codes or a recognised colour name and converts to rgb (helper funct)

Description

Checks colour variables are either RGB values, hex colour codes or a recognised colour name and converts to rgb (helper funct)

Usage

check_colour_return_rgb(colour, colour_variable_name)

Arguments

colour

The colour string / rgb vector to check

colour_variable_name

The name of the variable, for readability of error messages

Value

An error message if the colour value can't be interpreted

Examples

check_colour_return_rgb("White", "test_colour")
## Not run: check_colour_return_rgb("foo", "test_colour")


monochromeR documentation built on Sept. 8, 2023, 5:44 p.m.