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

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

## rescale() function

Take the input array of colors and extrapolates them to a larger palette of size targetSize. If preserveInputColors is false the input colors are evenly distributed into the output. Otherwise, the positions of the input colors are adjusted from a perfectly even distribution in order to ensure that the exact color values appearing in the input array also appear in the output array. The larger targetSize is compared to input.length the smaller those adjustments will be.

<b>Signature:</b>

```typescript
export declare function rescale(input: ColorRGBA64[], targetSize: number, preserveInputColors: boolean): ColorRGBA64[];
```

## Parameters

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

<b>Returns:</b>

[ColorRGBA64](./fast-colors.colorrgba64.md)<!-- -->\[\]
