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

[@microsoft/fast-colors](./fast-colors.md) &gt; [calculateOverlayColor](./fast-colors.calculateoverlaycolor.md)

## calculateOverlayColor() function

Calculate an overlay color that uses rgba (rgb + alpha) that matches the appearance of a given solid color when placed on the same background

<b>Signature:</b>

```typescript
export declare function calculateOverlayColor(rgbMatch: ColorRGBA64, rgbBackground: ColorRGBA64, rgbOverlay?: ColorRGBA64): ColorRGBA64;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  rgbMatch | [ColorRGBA64](./fast-colors.colorrgba64.md) | The solid color the overlay should match in appearance when placed over the rgbBackground |
|  rgbBackground | [ColorRGBA64](./fast-colors.colorrgba64.md) | The background on which the overlay rests |
|  rgbOverlay | [ColorRGBA64](./fast-colors.colorrgba64.md) | The rgb color of the overlay. Typically this is either pure white or pure black and when not provided will be determined automatically. This color will be used in the returned output |

<b>Returns:</b>

[ColorRGBA64](./fast-colors.colorrgba64.md)

The rgba (rgb + alpha) color of the overlay
