# How to change a circle's colour when the mouse hovers it?

**URL:** <https://discourse.processing.org/t/how-to-change-a-circles-colour-when-the-mouse-hovers-it/18192>\
**Category:** Coding Questions\
**Created:** [February 27, 2020, 5:46pm UTC](https://discourse.processing.org/t/how-to-change-a-circles-colour-when-the-mouse-hovers-it/18192 "2020-02-27T17:46:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)\
**Post date:** [February 27, 2020, 6:31pm UTC](https://discourse.processing.org/t/how-to-change-a-circles-colour-when-the-mouse-hovers-it/18192/2 "2020-02-27T18:31:09Z")

</div>

> [@How do I integrate dist() into my current code?](https://discourse.processing.org/t/how-do-i-integrate-dist-into-my-current-code/11313):
>
> Below is a simple program I am trying to build up. When the Ball object and Donut object intersect I would like: 1/ the ball to turn red 2/ the donut to turn blue 3/ the background to be a random color When there is no intersection of objects return to noFill and background to (255). I have currently placed pseudocode that i have commented out in the area I believe the actual code would appear. However, as a beginner I am struggling with how to integrate. Any guidance is most appreciated.…

**Click on link above to view thread.** Solution – syntax and placement – and importantly an explanation appears in the posts from @Chrisir

---

_[View the full topic](https://discourse.processing.org/t/how-to-change-a-circles-colour-when-the-mouse-hovers-it/18192)._
