Skip to main content

Function: getRelativeLuminance()

getRelativeLuminance(color): number

Calculates the relative luminance of a color according to WCAG 2.0.

Relative luminance represents the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white.

Parameters

ParameterTypeDescription
colorColorThe color to analyze.

Returns

number

A number between 0 (darkest black) and 1 (lightest white) representing the relative luminance.

Defined in

accessability/components/relative-luminance.ts:12