> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IWorkspaceStylingService

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/styling/index.ts

This service provides access to workspace styling settings such as color palette.

**Signature:**

```typescript
export interface IWorkspaceStylingService 
```

## Remarks

The contract here is that styling settings ARE applied in Analytical Designer and Dashboard applications and so any SDK code that embeds entities created by those applications MUST also use the same styling settings in order to maintain consistent user experience.

## Methods

| Method | Description |
| --- | --- |
| [clearActiveColorPalette()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingserviceclearactivecolorpalette) | Clear active color palette setting from workspace. |
| [clearActiveTheme()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingserviceclearactivetheme) | Clear active theme setting from workspace. |
| [createColorPalette(colorPalette)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicecreatecolorpalette) | Create a new color palette on the workspace level. |
| [createTheme(theme)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicecreatetheme) | Create a new theme on the workspace level. |
| [deleteColorPalette(colorPaletteRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicedeletecolorpalette) | Delete a color palette on the workspace level. |
| [deleteTheme(themeRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicedeletetheme) | Delete a theme on the workspace level. |
| [getActiveColorPalette()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetactivecolorpalette) | Request active color palette setting from workspace. |
| [getActiveTheme()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetactivetheme) | Request active theme setting from workspace. |
| [getAvailableColorPalettes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetavailablecolorpalettes) | Request all workspace-level color palettes the workspace can use. |
| [getAvailableThemes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetavailablethemes) | Request all workspace-level themes the workspace can use. |
| [getColorPalette()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalette) | Asynchronously returns items in the color palette. |
| [getColorPaletteByRef(colorPaletteRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalettebyref) | Read one color palette by reference, wherever the workspace can see it. |
| [getColorPalettes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalettes) | Request all color palettes defined on the workspace level. |
| [getTheme()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegettheme) | Asynchronously returns theme. |
| [getThemes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetthemes) | Request all themes defined on the workspace level. |
| [setActiveColorPalette(colorPaletteRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicesetactivecolorpalette) | Set active color palette setting in workspace. |
| [setActiveTheme(themeRef)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicesetactivetheme) | Set active theme setting in workspace. |
| [updateColorPalette(colorPalette)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingserviceupdatecolorpalette) | Update an existing color palette on the workspace level. |
| [updateTheme(theme)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingserviceupdatetheme) | Update an existing theme on the workspace level. |

## Method details

### IWorkspaceStylingService.clearActiveColorPalette()

Clear active color palette setting from workspace.

**Signature:**

```typescript
clearActiveColorPalette(): Promise<void>;
```
**Returns:**

Promise&lt;void&gt;

promise

### IWorkspaceStylingService.clearActiveTheme()

Clear active theme setting from workspace.

**Signature:**

```typescript
clearActiveTheme(): Promise<void>;
```
**Returns:**

Promise&lt;void&gt;

promise

### IWorkspaceStylingService.createColorPalette()

Create a new color palette on the workspace level.

**Signature:**

```typescript
createColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| colorPalette | [IColorPaletteDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettedefinition/index.md) | color palette definition |

**Returns:**

Promise&lt;[IColorPaletteMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettemetadataobject/index.md)&gt;

promise of the created color palette metadata object

### IWorkspaceStylingService.createTheme()

Create a new theme on the workspace level.

**Signature:**

```typescript
createTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| theme | [IThemeDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithemedefinition/index.md) | theme definition |

**Returns:**

Promise&lt;[IThemeMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithememetadataobject/index.md)&gt;

promise of the created theme metadata object

### IWorkspaceStylingService.deleteColorPalette()

Delete a color palette on the workspace level.

**Signature:**

```typescript
deleteColorPalette(colorPaletteRef: ObjRef): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| colorPaletteRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | color palette reference |

**Returns:**

Promise&lt;void&gt;

promise

### IWorkspaceStylingService.deleteTheme()

Delete a theme on the workspace level.

**Signature:**

```typescript
deleteTheme(themeRef: ObjRef): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| themeRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | theme reference |

**Returns:**

Promise&lt;void&gt;

promise

### IWorkspaceStylingService.getActiveColorPalette()

Request active color palette setting from workspace.

**Signature:**

```typescript
getActiveColorPalette(): Promise<ObjRef | undefined>;
```
**Returns:**

Promise&lt;[ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) &#124; undefined&gt;

promise of color palette object reference

### IWorkspaceStylingService.getActiveTheme()

Request active theme setting from workspace.

**Signature:**

```typescript
getActiveTheme(): Promise<ObjRef | undefined>;
```
**Returns:**

Promise&lt;[ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) &#124; undefined&gt;

promise of theme object reference

### IWorkspaceStylingService.getAvailableColorPalettes()

Request all workspace-level color palettes the workspace can use.

**Signature:**

```typescript
getAvailableColorPalettes(): Promise<IColorPaletteMetadataObject[]>;
```
**Returns:**

Promise&lt;[IColorPaletteMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettemetadataobject/index.md)[]&gt;

promise of array of color palette metadata objects

#### Remarks

The workspace's own palettes plus those inherited from its parent workspaces. Unlike [IWorkspaceStylingService.getColorPalettes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalettes), the result includes palettes the workspace cannot manage. Each reference is an `idRef` typed `"workspaceColorPalette"`, so it can be passed to [IWorkspaceStylingService.setActiveColorPalette()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicesetactivecolorpalette) as is. Palettes with invalid content are left out. Organization color palettes are not included; read them from the organization styling service.

### IWorkspaceStylingService.getAvailableThemes()

Request all workspace-level themes the workspace can use.

**Signature:**

```typescript
getAvailableThemes(): Promise<IThemeMetadataObject[]>;
```
**Returns:**

Promise&lt;[IThemeMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithememetadataobject/index.md)[]&gt;

promise of array of theme metadata objects

#### Remarks

The workspace's own themes plus those inherited from its parent workspaces. Unlike [IWorkspaceStylingService.getThemes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetthemes), the result includes themes the workspace cannot manage. Each reference is an `idRef` typed `"workspaceTheme"`, so it can be passed to [IWorkspaceStylingService.setActiveTheme()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicesetactivetheme) as is. Organization themes are not included; read them from the organization styling service.

### IWorkspaceStylingService.getColorPalette()

Asynchronously returns items in the color palette.

**Signature:**

```typescript
getColorPalette(): Promise<IColorPalette>;
```
**Returns:**

Promise&lt;[IColorPalette](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalette/index.md)&gt;

promise of color palette

### IWorkspaceStylingService.getColorPaletteByRef()

Read one color palette by reference, wherever the workspace can see it.

**Signature:**

```typescript
getColorPaletteByRef(colorPaletteRef: ObjRef): Promise<IColorPalette | undefined>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| colorPaletteRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | color palette reference |

**Returns:**

Promise&lt;[IColorPalette](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalette/index.md) &#124; undefined&gt;

promise of the color palette, or undefined where the workspace cannot see one

#### Remarks

The scope is carried by the reference itself, as it is for [IWorkspaceStylingService.setActiveColorPalette()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicesetactivecolorpalette): an `idRef` typed `"workspaceColorPalette"` names a workspace-scoped palette, one typed `"colorPalette"` an organization-scoped one. Both are read through this method. A workspace-scoped palette is reached whether the workspace owns it or inherits it from a parent, which is what separates this from [IWorkspaceStylingService.getColorPalettes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalettes).

### IWorkspaceStylingService.getColorPalettes()

Request all color palettes defined on the workspace level.

**Signature:**

```typescript
getColorPalettes(): Promise<IColorPaletteMetadataObject[]>;
```
**Returns:**

Promise&lt;[IColorPaletteMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettemetadataobject/index.md)[]&gt;

promise of array of color palette metadata objects

#### Remarks

The workspace's own palettes, which are the ones it can manage. A palette inherited from a parent workspace is not among them; use [IWorkspaceStylingService.getAvailableColorPalettes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetavailablecolorpalettes) to list those, or [IWorkspaceStylingService.getColorPaletteByRef()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetcolorpalettebyref) to read one that is merely referenced.

### IWorkspaceStylingService.getTheme()

Asynchronously returns theme.

**Signature:**

```typescript
getTheme(): Promise<ITheme>;
```
**Returns:**

Promise&lt;[ITheme](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.itheme/index.md)&gt;

promise of theme

### IWorkspaceStylingService.getThemes()

Request all themes defined on the workspace level.

**Signature:**

```typescript
getThemes(): Promise<IThemeMetadataObject[]>;
```
**Returns:**

Promise&lt;[IThemeMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithememetadataobject/index.md)[]&gt;

promise of array of theme metadata objects

#### Remarks

The workspace's own themes, which are the ones it can manage. A theme inherited from a parent workspace is not among them; use [IWorkspaceStylingService.getAvailableThemes()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacestylingservice/index.md#iworkspacestylingservicegetavailablethemes) for those.

### IWorkspaceStylingService.setActiveColorPalette()

Set active color palette setting in workspace.

**Signature:**

```typescript
setActiveColorPalette(colorPaletteRef: ObjRef): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| colorPaletteRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | active color palette reference |

**Returns:**

Promise&lt;void&gt;

promise

#### Remarks

The scope is carried by the reference itself: an `idRef` typed `"workspaceColorPalette"` activates a workspace-scoped color palette, otherwise it is treated as organization-scoped. There is no cross-scope fallback when the active setting is later resolved.

### IWorkspaceStylingService.setActiveTheme()

Set active theme setting in workspace.

**Signature:**

```typescript
setActiveTheme(themeRef: ObjRef): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| themeRef | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md) | active theme reference |

**Returns:**

Promise&lt;void&gt;

promise

#### Remarks

The scope is carried by the reference itself: an `idRef` typed `"workspaceTheme"` activates a workspace-scoped theme, otherwise the theme is treated as organization-scoped. There is no cross-scope fallback when the active setting is later resolved.

### IWorkspaceStylingService.updateColorPalette()

Update an existing color palette on the workspace level.

**Signature:**

```typescript
updateColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| colorPalette | [IColorPaletteDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettedefinition/index.md) | color palette definition |

**Returns:**

Promise&lt;[IColorPaletteMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icolorpalettemetadataobject/index.md)&gt;

promise of the updated color palette metadata object

### IWorkspaceStylingService.updateTheme()

Update an existing theme on the workspace level.

**Signature:**

```typescript
updateTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| theme | [IThemeDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithemedefinition/index.md) | theme definition |

**Returns:**

Promise&lt;[IThemeMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ithememetadataobject/index.md)&gt;

promise of the updated theme metadata object
