# filter(GRAY) makes everything gray

**URL:** <https://discourse.processing.org/t/filter-gray-makes-everything-gray/40725>\
**Category:** Coding Questions\
**Created:** [January 27, 2023, 4:44am UTC](https://discourse.processing.org/t/filter-gray-makes-everything-gray/40725 "2023-01-27T04:44:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![turke1034](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/turke1034/32/16910_2.png) [@turke1034](https://discourse.processing.org/u/turke1034)\
**Post date:** [January 27, 2023, 4:44am UTC](https://discourse.processing.org/t/filter-gray-makes-everything-gray/40725/1 "2023-01-27T04:44:35Z")

</div>

In my game I am trying to make a button grayscale (temporarily) but not anything else. But it seems that there is no way to disable a filter after it is applied?

```auto
pushStyle();
button.draw();
if (!button.pressable) filter(GRAY);
popStyle();

```

This is supposed to make the just the button gray (for some reason its also supposed to go after the button render??)

The code is at the end of the entire draw loop and it is also surrounded by push & pop style. I don’t understand why this works like this…

---

<div class="post-metadata">

**Author:** ![Mikey83](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mikey83/32/17956_2.png) [@Mikey83](https://discourse.processing.org/u/Mikey83)\
**Post date:** [January 27, 2023, 7:07am UTC](https://discourse.processing.org/t/filter-gray-makes-everything-gray/40725/2 "2023-01-27T07:07:54Z")

</div>

Try button.filter(GRAY); It may be the problem but not 100% sure without seeing the rest of the code, if that doesnt work either try

```auto
button.pushStyle();
button.draw();
if (!button.pressable) button.filter(GRAY);
button.popStyle();

```

hopefully one of them works
