color_luminance: Find the luminance of a particular color, scaled 0-1

View source: R/utils_css_color.R

color_luminanceR Documentation

Find the luminance of a particular color, scaled 0-1

Description

Find the luminance of a particular color, scaled 0-1

Usage

color_luminance(red, green, blue, alpha, ...)

Arguments

red, blue, green, alpha

numeric vectors with values in [0, M] where M is maxColorValue. When this is 255, the red, blue, green, and alpha values are coerced to integers in 0:255 and the result is computed most efficiently.

...

additional arguments See color_text_by_luminance for creating contrasting text color to a background.

Value

num

See Also

color_text_by_luminance()

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'))

yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.