Implement the different color for each face of the shape which is made by extrude geometry

You can also create a self-defined geometry. You only need 6 easy-to-define points and a total of 8 triangles. This is similar to these examples

BufferGeometryIndexed
BufferGeometryNonIndexed

from the Collection of examples from discourse.threejs.org .