# Can I make fill() static?

**URL:** <https://discourse.processing.org/t/can-i-make-fill-static/22978>\
**Category:** Beginners\
**Created:** [August 2, 2020, 1:24am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978 "2020-08-02T01:24:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkilum](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alkilum](https://discourse.processing.org/u/alkilum)\
**Post date:** [August 2, 2020, 1:24am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978/1 "2020-08-02T01:24:36Z")

</div>

So I wanted to call fill() in a subroutine and it apparently cannot be called in a static function. So I removed the static keyword and now there is no error, but the function doesn’t work anymore, it simply renders the same color as before. Is there a way I can make fill() static or do some sort of object call?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 2, 2020, 1:33am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978/2 "2020-08-02T01:33:20Z")

</div>

Hello,

Please provide a minimal example with the problem.

Formatting:  
[https://discourse.processing.org/faq#format-your-code](https://discourse.processing.org/faq#format-your-code)

Reference:  
[https://processing.org/reference/static.html](https://processing.org/reference/static.html)

`:)`

---

<div class="post-metadata">

**Author:** ![alkilum](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alkilum](https://discourse.processing.org/u/alkilum)\
**Post date:** [August 2, 2020, 1:47am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978/3 "2020-08-02T01:47:57Z")

</div>

```auto
public void rd(v){
  fill(#ff0000);
  line(0,0,511,511);
  return;
}

```

And fill() does not work. It simply keeps the old color.

---

<div class="post-metadata">

**Author:** ![alkilum](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alkilum](https://discourse.processing.org/u/alkilum)\
**Post date:** [August 2, 2020, 1:57am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978/5 "2020-08-02T01:57:07Z")

</div>

It said that fill cake from PApplet (idk what it is) so I tried creating a PApplet object and using that to reference but then my vm crashed 😕

---

<div class="post-metadata">

**Author:** ![alkilum](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alkilum](https://discourse.processing.org/u/alkilum)\
**Post date:** [August 2, 2020, 2:01am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978/6 "2020-08-02T02:01:04Z")

</div>

I should clarify it was the java vm
