LUMINANCE

Calculates the luma (perceptual brightness) of the specified color. Uses SMPTE C / Rec. 709 coefficients, as recommended in WCAG 2.0. For more information, see: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef

Syntax

=LUMINANCE(color)

Arguments

ArgumentTypeDescription
colorColorThe color

Examples

=LUMINANCE("#0000ff")0.0722
Gets the luminance for the color represented by the hex color code #0000ff (blue)

=LUMINANCE(RGB(0, 255, 0))0.7152
Gets the luminance for a color having a value of 128 for red, 128 for green, 128 for blue, and 0.5 for alpha

=LUMINANCE(0)#ERROR!
Attempts to get the luminance from an integer, which is invalid because it cannot be converted to a color