Skip to main content

@microsoft/fast-colors > rgbToLinearLuminance

rgbToLinearLuminance() function

Get the luminance of a color in the linear RGB space. This is not the same as the relative luminance in the sRGB space for WCAG contrast calculations. Use rgbToRelativeLuminance instead.

Signature:
export declare function rgbToLinearLuminance(rgb: ColorRGBA64): number;

Parameters

ParameterTypeDescription
rgbColorRGBA64The input color
Returns:

number