# How to update faces color

**URL:** <https://discourse.threejs.org/t/how-to-update-faces-color/8599>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [July 19, 2019, 10:11am UTC](https://discourse.threejs.org/t/how-to-update-faces-color/8599 "2019-07-19T10:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FilipLitwora](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@FilipLitwora](https://discourse.threejs.org/u/FilipLitwora)\
**Post date:** [July 19, 2019, 10:11am UTC](https://discourse.threejs.org/t/how-to-update-faces-color/8599/1 "2019-07-19T10:11:48Z")

</div>

Hi, how to update faces.color in three js ? my code is :

```
mesh.geometry.faces.forEach((face, index) => {
  face.color = `rgb(${index}, ${index}, ${index})`;
});
mesh.geometry.elementsNeedUpdate = true;
mesh.geometry.colorsNeedUpdate = true;
mesh.geometry.groupsNeedUpdate = true;

```

but color is not changing…

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [July 19, 2019, 12:44pm UTC](https://discourse.threejs.org/t/how-to-update-faces-color/8599/2 "2019-07-19T12:44:14Z")

</div>

Um, you normally do this like so:

```auto
var faces = geometry.faces;

for ( var face of faces ) {

	face.color.set( Math.random() * 0xffffff );

}

geometry.colorsNeedUpdate = true;

```

Demo: [https://jsfiddle.net/e5sp31nf/](https://jsfiddle.net/e5sp31nf/)

---

<div class="post-metadata">

**Author:** ![FilipLitwora](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@FilipLitwora](https://discourse.threejs.org/u/FilipLitwora)\
**Post date:** [July 19, 2019, 12:59pm UTC](https://discourse.threejs.org/t/how-to-update-faces-color/8599/3 "2019-07-19T12:59:12Z")

</div>

Nvm, colors were changing but they all were white so i didnt see changes…
