@microsoft/fast-colors > contrastRatio
contrastRatio() function
Calculate the contrast ratio between two colors. Uses the formula described by WCAG 2.0.
Signature:export declare function contrastRatio(a: ColorRGBA64, b: ColorRGBA64): number;
Parameters
| Parameter | Type | Description |
|---|---|---|
| a | ColorRGBA64 | |
| b | ColorRGBA64 |
number
Remarks
The alpha channel of the input is ignored