Viewer, apply multiple colors at once

Hey @Exilliar, and welcome to the community! The setUserObjectColors method takes an array of objects that look like { objectIds: string[]; color: string;}.

Example usage:

viewer.setUserObjectColors([
  {
    objectIds: [
      'fb70810f971a483d4fb5fb682e82d93b',
      'b3ecedd447c4cf5a316a2012aa0203f9',
      'e464fd34c72c23decd13daca9c480d70',
      '8cb410758876a45500cb66bead31b848'
    ],
    color: '#8b5cf6'
  },
  {
    objectIds: [
      'df0fb33a36920574d871bdfc61a293b8',
      '97fa793822624ef179532882a8bba3bd',
      '02b2d39c2fb75ce241ba87a60d1cefba',
      '06986d19d8e7d6280decee2137f816c8',
      '831f0d944d62fa0aadcee1426a5a4c3a',
      'd5915a54844b30db08a28fb609a2e43f',
      '6b3a510fa659961393f2cdc8170a4577',
      '3270b43a4bb93384cdac235d05f2454b',
      '0a45db8e5cba3e8eb243438b1bde0f01',
      'df54b6545bc1d923caf8d2a4d75572f5',
      'f034f2e68483249324e71292332f178b'
    ],
    color: '#f472b6'
  }
])

Dim/viewer 1201 by didimitrie · Pull Request #1205 · specklesystems/speckle-server · GitHub. I’ve also noticed i need to follow up on the original thread :smiley:

1 Like