liveBook · Manning

Relative luminance

Relative luminance is a normalized measure of a color’s apparent brightness calculated from the weighted contributions of its linearized red, green, and blue components.

How 2 Manning books explain it

Math for Web Design

Relative luminance is a normalized measure of the perceived lightness of a color, computed from linearized red, green, and blue components and ranging from black at 0 to white at 1.

How it is used
Uses relative luminance to calculate WCAG contrast ratios for accessible text and color pairs.
How deep it goes
Descends through sRGB normalization, piecewise gamma correction, weighted summation, contrast calculation, and JavaScript implementation.
Examples
Uses pure blue against white, a JavaScript contrast calculator, and a CSS text-and-background compliance exercise.
What you can do after
Apply it via JavaScript to compute luminance and contrast ratios from RGB or hexadecimal colors.

Read how Math for Web Design explains relative luminance →

Everyday Data Visualization

Relative luminance is a normalized measure of the light emitted or reflected by a color relative to a reference white.

How it is used
Supports accessible color choices for text, data visualizations, and other foreground-background pairings.
How deep it goes
Defines the contrast formula and thresholds, but defers luminance mathematics to external calculators.
Examples
Uses blue bars on light gray, comparing 1.93:1 without a border against 8.7:1 with a dark-gray border.
What you can do after
Apply it via an accessible-colors calculator to evaluate foreground-background contrast and adjust visual elements.

Read how Everyday Data Visualization explains relative luminance →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.