# How can I check that the pixel has color?

**URL:** https://discourse.processing.org/t/how-can-i-check-that-the-pixel-has-color/19633
**Category:** Coding Questions
**Tags:** homework
**Created:** [April 10, 2020, 3:22pm UTC](https://discourse.processing.org/t/how-can-i-check-that-the-pixel-has-color/19633 "2020-04-10T15:22:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tauter](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tauter](https://discourse.processing.org/u/Tauter)
#### Post date: [April 10, 2020, 3:22pm UTC](https://discourse.processing.org/t/how-can-i-check-that-the-pixel-has-color/19633/1 "2020-04-10T15:22:49Z")

</div>

I’m allowed to use only get(), background() methods and color data type.  
How can I check that the given pixel (x,y), is background colored(black) or not ?  
I can’t figure it out from the references.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [April 10, 2020, 3:44pm UTC](https://discourse.processing.org/t/how-can-i-check-that-the-pixel-has-color/19633/2 "2020-04-10T15:44:17Z")

</div>

Use

color c1=get(x,y);

if(c1!=color(0))

---

<div class="post-metadata">

### Author: ![Tauter](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tauter](https://discourse.processing.org/u/Tauter)
#### Post date: [April 10, 2020, 4:31pm UTC](https://discourse.processing.org/t/how-can-i-check-that-the-pixel-has-color/19633/3 "2020-04-10T16:31:31Z")

</div>

Thank you it works! But with the default color of the point, which is 30 and not black. It’s my bad.
