How to change the color of the polygons of an object during a collision in Three JS?

You can change colors of individual vertices of a geometry using vetrtexColor attribute, like so: