lx_check_color: check if 'LIFX' color name is valid

Description Usage Arguments Details Value Examples

View source: R/color_name.R

Description

check if 'LIFX' color name is valid

Usage

1
lx_check_color(color_name, token = lx_get_token())

Arguments

color_name

a color string in 'LIFX' api format (can be made with lx_color_name )

token

API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see lx_save_token)

Details

calls the API endpoint https://api.lifx.com/v1/color to check if the color is valid.

Value

logical TRUE if the color name is valid; FALSE if not; throws an error if the API could not be reached or another issue occurred.

Examples

1
2
3
4
5
6
7
## Not run: 
lx_check_color("INVALID_COLOR_NAME") # invalid 'LIFX' color string returns FALSE
lx_check_color("#FFFFFF") # valid 'LIFX' color string returns TRUE
lx_check_color("orange") # valid 'LIFX' color string returns TRUE
lx_check_color('brightness:1 hue:50') # valid 'LIFX' color string returns TRUE

## End(Not run)

lifx documentation built on July 1, 2020, 6:08 p.m.