Coloring a face in buffer geometry

Take a look at the Collection of examples from discourse.threejs.org

for instance

https://hofk.de/main/discourse.threejs/2017/index2017.html

https://hofk.de/main/discourse.threejs/2017/BufferGeometry/BufferGeometry.html
https://hofk.de/main/discourse.threejs/2017/Indexed%20BufferGeometry/Indexed%20BufferGeometry.html


https://hofk.de/main/discourse.threejs/2018/index2018.html

https://hofk.de/main/discourse.threejs/2018/BufferWithNormals/BufferWithNormals.html


https://hofk.de/main/discourse.threejs/2019/index2019.html

https://hofk.de/main/discourse.threejs/2019/ColorStripeChanging/ColorStripeChanging.html

Note!
.addAttribute now is .setAttribute