Methods
Object
getObjectColors
Returns a map of the specified objects and their colors.
The map only contains objects assigned a custom color using setObjectColors.
JS
1const objectIds = ["object-1", "object-2"];
2
3const objectColorMap = viewer3d.getObjectColors(objectIds);
List of object ids.
Type | Required |
---|---|
Array[String] | Yes |
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 |
JS
1{
2 objectId: {
3 color: {
4 r: 1,
5 g: 0,
6 b: 0,
7 },
8 opacity: 1,
9 style: "#ff0000ff",
10 },
11};
Updated 13 Sep 2024
Did this page help you?