Coloring a face in buffer geometry

If I have created say a rectangular Pyramid not using cone geometry, but using buffer geometry and co-ordinates, how do i color it?

There are multiple examples which demonstrate how to add vertex colors to an instance of BufferGeometry. For example webgl_buffergeometry or webgl_geometry_colors.

I suggest you study the related code first. If you stuck, please your current work of progress as a editable live example.

Take a look at the Collection of examples from

for instance

.addAttribute now is .setAttribute

I got my solution, Thank you.