lx_color_name {lifx} | R Documentation |
picking a color by name or hsbk
Description
picking a color by name or hsbk
Usage
lx_color_name(
hue = NULL,
saturation = NULL,
brightness = NULL,
kelvin = NULL,
color_name = NULL,
check = TRUE,
token = lx_get_token()
)
Arguments
hue |
set the hue (0-255) |
saturation |
set the saturation (0-1) |
brightness |
set the brightness (0-1) |
kelvin |
set the color temperature. limits depend on the specific lamp; limits are likely in the range of 2500-9000 |
color_name |
a color name (i.e. "red"), hexadecimal color code (i.e. "#FF0000") or output from lx_color() (in 'LIFX' api format (see https://api.developer.lifx.com/docs/colors). If this parameter is used, other parameters may be ignored. |
check |
if FALSE does not call the API to check if the color is valid |
token |
API token (see ?lx_save_token). If left empty, the token is retrieved from the environmental variable if available. (see |
Value
a character string specifying a light color as expected by the 'LIFX' API. Outputs from this function have their own class and printing style, but a pure character string can be used just as well.
Examples
## Not run:
strong_red <- lx_color_name(hue = 0, saturation = 1, brightness = 1)
lx_color(color_name = strong_red)
dim_green <- lx_color_name(color_name = "#00FF00", saturation = 1, brightness = 0.1)
lx_color(color_name = dim_green)
unsaturated_cyan <- lx_color_name(color_name = "cyan", saturation = 0.3)
lx_color(color_name = unsaturated_cyan)
## End(Not run)