Find the luminance of a particular color, scaled 0-1
color_luminance.RdFind 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, andalphavalues are coerced to integers in0:255and the result is computed most efficiently.- ...
additional arguments See
color_text_by_luminancefor 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