# Newbie - trying to change colors

**URL:** <https://discourse.processing.org/t/newbie-trying-to-change-colors/8870>\
**Category:** Beginners\
**Created:** [March 3, 2019, 12:03am UTC](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870 "2019-03-03T00:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBG](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@BBG](https://discourse.processing.org/u/BBG)\
**Post date:** [March 3, 2019, 12:03am UTC](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870/1 "2019-03-03T00:03:41Z")

</div>

So what I want is to change the color of the background of this processing project. I keep being told that a } bracket is missing and an expecting EOF (not sure what that means).

Can anyone point out what it is that I am doing wrong?  
I have setup in place, draw, specify a size, make sure all the }{ match. HELP! 😉

* * *

```auto
void setup(){
  size (600,600);
}
void draw(){
  
}
if (mouseX < width/3){
  background (255);
} else if (mouseX < 2*width/3){
  background (127);
} else {
  background (0);
}

```

* * *

If I run this, I get a project window with color 255 that does not change. Its supposed to change when moving the mouse. (Its an example from Learning Processing). I am not sure why its not working.

* * *

```auto
if (mouseX < width/3){
  background (255);
} else if (mouseX < 2*width/3){
  background (127);
} else {
  background (0);
}

```

---

<div class="post-metadata">

**Author:** ![hotfooted](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hotfooted/32/3670_2.png) [@hotfooted](https://discourse.processing.org/u/hotfooted)\
**Post date:** [March 3, 2019, 1:25am UTC](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870/2 "2019-03-03T01:25:51Z")

</div>

your ifs are outside draw

```auto
void setup() {
  size (600, 600);
}
void draw() {
  if (mouseX < width/3) {
    background (255);
  } else if (mouseX < 2*width/3) {
    background (127);
  } else {
    background (0);
  }
}

```

you can format the code you paste with the \</\> button 🙂

---

<div class="post-metadata">

**Author:** ![BBG](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@BBG](https://discourse.processing.org/u/BBG)\
**Post date:** [March 3, 2019, 7:37am UTC](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870/3 "2019-03-03T07:37:08Z")

</div>

Thank you for the troubleshooting lesson. Its highly appreciated. 🙂
