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

[@microsoft/fast-colors](./fast-colors.md) &gt; [rgbToRelativeLuminance](./fast-colors.rgbtorelativeluminance.md)

## rgbToRelativeLuminance() function

Get the relative luminance of a color. Adjusts the color to sRGB space, which is necessary for the WCAG contrast spec. The alpha channel of the input is ignored.

<b>Signature:</b>

```typescript
export declare function rgbToRelativeLuminance(rgb: ColorRGBA64): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  rgb | [ColorRGBA64](./fast-colors.colorrgba64.md) | The input color |

<b>Returns:</b>

number
