Checking if the two colliding objects have the same RGBA settings

I can’t seem to find the answer to this question on the forums or on tutorials… so was hoping someone could help…

I would like to create and if/else statement after collision - - in JavaScript

If the two colliding objects (wall and player) have the same RGBA values then execute function 1

If the two colliding object have different RGBA values then execute function 2.

Would be grateful for a pointer

Cheers

use renderer.material.color:

if(objectA.renderer.material.color == objectb.renderer.material.color){
//1 thing
}
else{
//other thing
}

etc…

this should work I believe