---
title: "Swatch | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/Swatch/"
---

# Swatch

> - [`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent)

## Classes

### Swatch

#### Extends

#### Constructors

##### Constructor

```ts
new Swatch(id?, name?): Swatch;
```

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `id?` | `string` | `undefined` |
| `name?` | `string` | `""` |

###### Returns

[`Swatch`](#swatch)

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`constructor`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#constructor)

#### Properties

##### id

```ts
id: string;
```

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`id`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#id)

#### Accessors

##### color

###### Get Signature

```ts
get color(): Color;
```

###### Returns

[`Color`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/Color.md#abstract-color)

###### Set Signature

```ts
set color(value): void;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | [`Color`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/Color.md#abstract-color) |

###### Returns

`void`

##### name

###### Get Signature

```ts
get name(): string;
```

###### Returns

`string`

###### Set Signature

```ts
set name(value): void;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

###### Returns

`void`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`name`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#name)

##### tags

###### Get Signature

```ts
get tags(): object;
```

###### Returns

`object`

###### Set Signature

```ts
set tags(value): void;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | \{ \[`key`: `string`\]: `any`; \} |

###### Returns

`void`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`tags`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#tags)

##### version

###### Get Signature

```ts
get version(): string;
```

###### Returns

`string`

###### Inherited from

[`SurfaceMockup`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/SurfaceMockup.md#surfacemockup).[`version`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/SurfaceMockup.md#version)

#### Methods

##### addPropertyChanged()

```ts
addPropertyChanged(listener): void;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `listener` | (`sender`, `eventArgs`) => `void` |

###### Returns

`void`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`addPropertyChanged`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#addpropertychanged)

##### clone()

```ts
clone(generateNewIds?): Swatch;
```

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `generateNewIds` | `boolean` | `false` |

###### Returns

[`Swatch`](#swatch)

##### equals()

```ts
equals(other): boolean;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `other` | [`Swatch`](#swatch) |

###### Returns

`boolean`

###### Overrides

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`equals`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#equals)

##### generateNewIds()

```ts
generateNewIds(): void;
```

###### Returns

`void`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`generateNewIds`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#generatenewids)

##### getSimplifiedObject()

```ts
getSimplifiedObject(omitProperties?): object;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `omitProperties?` | `string` \| `string`[] |

###### Returns

`object`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`getSimplifiedObject`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#getsimplifiedobject)

##### removePropertyChanged()

```ts
removePropertyChanged(listener): void;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `listener` | (`sender`, `eventArgs`) => `void` |

###### Returns

`void`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`removePropertyChanged`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#removepropertychanged)

##### toString()

```ts
toString(): string;
```

Returns a string representation of an object.

###### Returns

`string`

###### Inherited from

[`ModelComponent`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#abstract-modelcomponent).[`toString`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/ModelComponent.md#tostring)
