@microsoft/fast-components > Palette
Palette interface
A collection of Swatch instances
Signature:export interface Palette<T extends Swatch = Swatch>
Properties
Property | Type | Description |
---|---|---|
source | T | |
swatches | ReadonlyArray<T> |
Methods
Method | Description |
---|---|
closestIndexOf(reference) | Returns the index of the palette that most closely matches the relativeLuminance of the provided swatch |
colorContrast(reference, contrast, initialIndex, direction) | Returns a swatch from the palette that most closely matches the contrast ratio provided to a provided reference. |
get(index) | Gets a swatch by index. Index is clamped to the limits of the palette so a Swatch will always be returned. |