Learn R Programming

monochromeR (version 0.2.0)

check_colour_return_rgb: 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)

Value

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

Arguments

colour

The colour string / rgb vector to check

colour_variable_name

The name of the variable, for readability of error messages

Examples

Run this code
check_colour_return_rgb("White", "test_colour")
if (FALSE) check_colour_return_rgb("foo", "test_colour")

Run the code above in your browser using DataLab