# How to change color of graphics once created?

**URL:** <https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844>\
**Category:** Phaser 3\
**Created:** [March 26, 2019, 11:38am UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844 "2019-03-26T11:38:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [March 26, 2019, 11:38am UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844/1 "2019-03-26T11:38:15Z")

</div>

Hi phaser’s guys,  
Is it possible to change the color of a graphics once it has already been created?

The fillStyle Method (mygraphics.fillStyle(0x44ff44,1) as defined in [https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Graphics.html](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Graphics.html) doesn’t seem to work in this case : In fact I guess the fillStyle Method is functionnal only for graphics instantiation…

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 26, 2019, 6:51pm UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844/2 "2019-03-26T18:51:33Z")

</div>

Graphics have to be cleared and redrawn.

---

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [March 27, 2019, 4:07pm UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844/3 "2019-03-27T16:07:39Z")

</div>

Thanks, that’s what I thought… I dont understand why this possibility has not been implemented…

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 27, 2019, 5:44pm UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844/4 "2019-03-27T17:44:02Z")

</div>

You can use a [Shape](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Shape.html) instead, maybe.

---

<div class="post-metadata">

**Author:** ![jef](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jef](https://phaser.discourse.group/u/jef)\
**Post date:** [March 27, 2019, 6:05pm UTC](https://phaser.discourse.group/t/how-to-change-color-of-graphics-once-created/1844/5 "2019-03-27T18:05:12Z")

</div>

It works with a shape and setFillStyle. thanks for this solution.
