---
title: "ColorPalette | Customer&#x27;s Canvas"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ColorPalette/"
archived: false
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Customer's Canvas Hub"
    versions: ["cloud"]
    entity_id: "https://customerscanvas.com/products/hub#software-application"
  - product: "Design Atoms JS"
    versions: ["7.4"]
---

# ColorPalette

**Applies to:** Customer's Canvas On-Premises; Customer's Canvas Hub cloud; Design Atoms JS 7.4

> API reference for the ColorPalette module in @aurigma/design-atoms-text.

## Classes

### ColorPalette

#### Implements

- [`IColorPalette`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#icolorpalette)

#### Constructors

##### Constructor

```ts
new ColorPalette(colors): ColorPalette;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `colors` | [`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata)[] |

###### Returns

[`ColorPalette`](#colorpalette)

#### Methods

##### addColor()

```ts
addColor(colorData): number;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `colorData` | [`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata) |

###### Returns

`number`

##### addColorToPaletteReturnIndex()

```ts
addColorToPaletteReturnIndex(colorData): number;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `colorData` | [`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata) |

###### Returns

`number`

###### Implementation of

[`IColorPalette`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#icolorpalette).[`addColorToPaletteReturnIndex`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#addcolortopalettereturnindex)

##### containsColor()

```ts
containsColor(color): boolean;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `color` | `Color` |

###### Returns

`boolean`

##### containsColorWithIndex()

```ts
containsColorWithIndex(index): boolean;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `index` | `number` |

###### Returns

`boolean`

##### getColorByIndex()

```ts
getColorByIndex(index): IColorData;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `index` | `number` |

###### Returns

[`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata)

##### getIndex()

```ts
getIndex(color): number;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `color` | `Color` |

###### Returns

`number`

##### getPaletteColorAt()

```ts
getPaletteColorAt(index): IColorData;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `index` | `number` |

###### Returns

[`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata)

###### Implementation of

[`IColorPalette`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#icolorpalette).[`getPaletteColorAt`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#getpalettecolorat)

##### getPaletteColors()

```ts
getPaletteColors(): IColorData[];
```

###### Returns

[`IColorData`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorData.md#icolordata)[]

###### Implementation of

[`IColorPalette`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#icolorpalette).[`getPaletteColors`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/IColorPalette.md#getpalettecolors)
