getObjectColors
Returns a map of the specified objects and their colors.
The map only contains objects assigned a custom color using setObjectColors.
Example
Usage
const objectIds = ["object-1", "object-2"];
const objectColorMap = viewer3d.getObjectColors(objectIds);Parameters
objectIds
List of object ids.
Type | Required |
|---|---|
Array[String] | Yes |
Return Value
Map of object ids and their colors.
Type |
|---|
Map[Object] |
Properties
Name | Type | Description |
|---|---|---|
color | Object | RGB color components of the object |
opacity | Number | Opacity of the object |
style | String | RGBA Hex value of the color, i.e. #ff0000ff |
Color
Name | Type | Description |
|---|---|---|
r | Number | Red component |
g | Number | Green component |
b | Number | Blue component |
Example
{
objectId: {
color: {
r: 1,
g: 0,
b: 0,
},
opacity: 1,
style: "#ff0000ff",
},
};