Skip to main content
Version: 1.x

@microsoft/fast-components > Palette > colorContrast

Palette.colorContrast() method

Returns a swatch from the palette that most closely matches the contrast ratio provided to a provided reference.

Signature:
colorContrast(reference: Swatch, contrast: number, initialIndex?: number, direction?: 1 | -1): T;

Parameters

ParameterTypeDescription
referenceSwatch
contrastnumber
initialIndexnumber
direction1 | -1
Returns:

T