Hi, I have a color attribute:
MyScript.attributes.add('theme_default_color', {
type: 'rgb',
default: [1, 0, 0]
});
…and then in my script i want to set an object based on this color , but it doesnt work
Setting it manually like this works fine:
material.emissive.set(1, 0, 0);
but doing this doesnt work…
material.emissive.set(this.theme_default_color);
The color gets set to black.
Any ideas?
p.s.I also tried
material.emissive.set(this.theme_default_color.r,this.theme_default_color.g,this.theme_default_color.b);
additionally this doesnt work either:
material.emissive.set(new pc.Color(this.theme_default_color));
…but I still got black.
Cheers