# Filling the overlap of 2 circles

**URL:** <https://discourse.processing.org/t/filling-the-overlap-of-2-circles/43165>\
**Category:** Coding Questions\
**Created:** [November 7, 2023, 7:28pm UTC](https://discourse.processing.org/t/filling-the-overlap-of-2-circles/43165 "2023-11-07T19:28:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SkaterDodo](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@SkaterDodo](https://discourse.processing.org/u/SkaterDodo)\
**Post date:** [November 7, 2023, 7:28pm UTC](https://discourse.processing.org/t/filling-the-overlap-of-2-circles/43165/1 "2023-11-07T19:28:28Z")

</div>

Hi everyone!

So I was wondering if its possible to fill the part that is overlaping of 2 circles overlaping and leave the rest white or in a different color.

The problem extends a little from this, but I feel that if I knew how to do this I’d know how to solve the actual problem.

Thanks guys!

---

<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:** [November 8, 2023, 4:56am UTC](https://discourse.processing.org/t/filling-the-overlap-of-2-circles/43165/2 "2023-11-08T04:56:17Z")

</div>

What first comes to mind

Make a PGraphics of the same size as your window

put the 2 circles with fill(55, 60);

you will have a mixed color in the overlap area

Find this color C1 by using get on the point between the 2 centers

Now check each pixel of both circles using get  
and if equal C1 use set on the original Sketch  
(same position) - or put in an Arraylist of PVector
