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

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

## centeredRescale() function

Takes an input array of colors and extrapolates them to a larger palette. The mapping first takes the input array and extrapolates between each color so that they are separated by spacing-1 slots. Then it adds to either end enough new colors to make up the desired targetSize. All output color slots between the defined stops are interpolated.

<b>Signature:</b>

```typescript
export declare function centeredRescale(input: ColorRGBA64[], config?: CenteredRescaleConfig): ColorRGBA64[];
```

## Parameters

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

<b>Returns:</b>

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

## Example

For an input array with length 5, a targetSize of 17 and spacing of 3 the output would be: 0: scaleColorLight 1: 2: input 0 3: 4: 5: input 1 6: 7: 8: input 2 9: 10: 11: input 3 12: 13: 14: input 4 15: 16: scaleColorDark
