---
id: fast-components.palette.closestindexof
title: Palette.closestIndexOf() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-components](./fast-components.md) &gt; [Palette](./fast-components.palette.md) &gt; [closestIndexOf](./fast-components.palette.closestindexof.md)

## Palette.closestIndexOf() method

Returns the index of the palette that most closely matches the relativeLuminance of the provided swatch

<b>Signature:</b>

```typescript
closestIndexOf(reference: RelativeLuminance): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  reference | RelativeLuminance |  |

<b>Returns:</b>

number
