---
id: fast-colors.matchlightnessindex
title: matchLightnessIndex() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-colors](./fast-colors.md) &gt; [matchLightnessIndex](./fast-colors.matchlightnessindex.md)

## matchLightnessIndex() function

Takes the input color and compares it to each color in the reference array to find the index with the closest Lightness value in HSL color space

<b>Signature:</b>

```typescript
export declare function matchLightnessIndex(input: ColorRGBA64, reference: ColorRGBA64[]): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  input | [ColorRGBA64](./fast-colors.colorrgba64.md) |  |
|  reference | [ColorRGBA64](./fast-colors.colorrgba64.md)<!-- -->\[\] |  |

<b>Returns:</b>

number
