---
title: setObjectColors
slug: viewer-3d/methods/setObjectColors
docTags: 
createdAt: 2024-03-01T14:17:48.684Z
---

Applies a color to the specified objects.

## Example

::codepen{url="https://codepen.io/Catenda/embed/XWLyJZQ"}

## Usage

```javascript
const objectIds = ["object-1", "object-2"];
const color = "red";

viewer3d.setObjectColors(objectIds, color);
```

## Parameters

### objectIds

List of object ids to apply the color to.

| **Type**       | **Required** |
| -------------- | ------------ |
| Array\[String] | Yes          |

### color

Color to apply.

:::hint{type="info"}
Value provided must be compatible with [THREE.Color](https://threejs.org/docs/#api/en/math/Color).
:::

| **Type**         | **Required** |
| ---------------- | ------------ |
| String or Number | Yes          |

