Find the luminance of a particular color, scaled 0-1
color_luminance.Rd
Find the luminance of a particular color, scaled 0-1
Arguments
- red, blue, green, alpha
numeric vectors with values in \([0, M]\) where \(M\) is
maxColorValue
. When this is255
, thered
,blue
,green
, andalpha
values are coerced to integers in0:255
and the result is computed most efficiently.- ...
additional arguments See
color_text_by_luminance
for creating contrasting text color to a background.
See also
Other color:
color_cycle()
,
color_distance()
,
color_match()
,
color_rgb_table()
,
color_separate()
,
color_text_by_luminance()
,
colors2css()
,
css_col2vec()
,
luminance_filter()
,
rgb2hex()
Examples
rlang::exec(color_luminance, !!!css_col2vec('white'))
#> [1] 1