# Fill color not working

**URL:** <https://discourse.processing.org/t/fill-color-not-working/10600>\
**Category:** Beginners\
**Created:** [April 24, 2019, 5:21pm UTC](https://discourse.processing.org/t/fill-color-not-working/10600 "2019-04-24T17:21:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhurst](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/nhurst/32/4805_2.png) [@nhurst](https://discourse.processing.org/u/nhurst)\
**Post date:** [April 24, 2019, 5:21pm UTC](https://discourse.processing.org/t/fill-color-not-working/10600/1 "2019-04-24T17:21:31Z")

</div>

Not sure what I expected isn’t happening?  
The following draws a square, loops, reduces size of square and rotates slightly. Each square should be filled with a color that changes.  
However, at the end of the program, all the squares are filled with the same color, which is the initial color  
Any pointers would be good

Thanks  
Neil

```auto
int r=216;
int g=33;
int b=33;

void setup(){
 size(400,400);
 noLoop();
}

void draw(){
 translate(200,200);
 rectMode(RADIUS);
 for(int x=150;x>0;x=x-5){
   rect(0,0,x,x);
   rotate(2);
   fill(r,g,b);
   g++;
   b++;
 }
}

```

---

<div class="post-metadata">

**Author:** ![nhurst](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/nhurst/32/4805_2.png) [@nhurst](https://discourse.processing.org/u/nhurst)\
**Post date:** [April 24, 2019, 5:22pm UTC](https://discourse.processing.org/t/fill-color-not-working/10600/2 "2019-04-24T17:22:34Z")

</div>

Sorry, please ignore my post. It is working, but the color change I was making was too small

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [April 24, 2019, 5:25pm UTC](https://discourse.processing.org/t/fill-color-not-working/10600/3 "2019-04-24T17:25:14Z")

</div>

Also, traditionally, one sets the fill color BEFORE they draw the shape - not AFTER.

Nobody paints a picture and then decided what colors to use later. Set the color first!
