lx_check_color {lifx} | R Documentation |
check if 'LIFX' color name is valid
Description
check if 'LIFX' color name is valid
Usage
lx_check_color(color_name, token = lx_get_token())
Arguments
color_name |
a color string in 'LIFX' api format (can be made with |
token |
API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see |
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
## 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)
[Package lifx version 0.2.0 Index]