Skip to contents

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

Examples

rlang::exec(color_luminance, !!!css_col2vec('white'))
#> [1] 1