---
id: fast-components.swatch.contrast
title: Swatch.contrast() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-components](./fast-components.md) &gt; [Swatch](./fast-components.swatch.md) &gt; [contrast](./fast-components.swatch.contrast.md)

## Swatch.contrast() method

<b>Signature:</b>

```typescript
contrast(target: RelativeLuminance): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | RelativeLuminance |  |

<b>Returns:</b>

number
