I have some color codes returned from an API dynamically. I want to use those code as values for setThemingcolor method in my viewer app. How can I do that?
I tried,
let color = new THREE.Color( 0xff0000 );
window.viewer.setThemingColor(workorder.resource.data.autodeskid,color)
But it's not working. The doc states to use vector4 with (r,g,b,i) values. But is there a way I could directly use the hexadecimal color code in it.
Please do help. Thanks in advance.
Edit:
The suggested answer helps and I have tried that already, but what I was expecting is something from the Autodesk viewer API point of view from the community. It helps as a quick hack but I was expecting the reason behind the single format support for color from the team. Anyway, thanks for the suggestion. But I'm keeping this open just to get few more inputs on this.