CCalclabhub

Color

Relative luminance

Each channel is linearised and then weighted by the eye's sensitivity, which is highest for green.

Last updated

The Formula

L = 0.2126 R + 0.7152 G + 0.0722 B (gamma corrected)

Each channel is linearised and then weighted by the eye's sensitivity, which is highest for green.

SymbolMeaning
R'Linear red
G'Linear green
B'Linear blue

What Each Symbol Means

R'0-1

Linear red

Red channel after the sRGB gamma correction.

G'0-1

Linear green

Green channel after the sRGB gamma correction.

B'0-1

Linear blue

Blue channel after the sRGB gamma correction.

See It Worked With Real Numbers

A formula on its own does not tell you which number goes where. The how to convert colors page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.

Where This Formula Appears

This equation is the working core of How To Convert Colors, filed under Unit Conversion. Every number the guide produces comes from substituting into this one line.

Common Questions

What is the formula for Relative luminance?

The formula for Relative luminance is L = 0.2126 R + 0.7152 G + 0.0722 B (gamma corrected). Each channel is linearised and then weighted by the eye's sensitivity, which is highest for green.

What units should I use with Relative luminance?

Substitute R' in 0-1, G' in 0-1, B' in 0-1. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.

What is a common mistake when using Relative luminance?

Treating hex letters as text. A to F stand for the values ten to fifteen. Comparing them as letters rather than numbers breaks the conversion.