get_brightness: Get color's brightness

Description Usage Arguments Value Examples

Description

Get the brightness of a color vector.

Usage

1
get_brightness(x, na.rm = FALSE)

Arguments

x

a any type color string or a javascript color object specifying.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

Returns the brightness of the color, values in the range of 0 to 255.

Examples

1
2
3
get_brightness("#F00")
get_brightness("{ r: 1, g: 0, b: 0 }")
get_brightness("{ h: 0.5, s: 0.5, v: 0.5 }")

houyunhuang/tinycolor documentation built on June 6, 2019, 7:43 p.m.