I've got the hang of setting an object's color property, but I'm struggling to check if it's been set correctly. My goal is to compare the color of an object's mesh in order to manipulate it based on a given condition.
Here's some basic code:
object.traverse( function( child ) {
if ( child instanceof THREE.Mesh ) {
child.castShadow = true;
child.material.color.set(0x00ff00);
if ( child.material.color == '0x00ff00' ) { //this comparison check
child.material.color.set(0x0000ff);
}
}
} );
I'm wondering if this comparison method is correct, or if there is another way to confirm the property's value.