# Hovering over an image and changing colour

**URL:** <https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319>\
**Category:** Coding Questions\
**Created:** [October 10, 2018, 9:38am UTC](https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319 "2018-10-10T09:38:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![livgrisss](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@livgrisss](https://discourse.processing.org/u/livgrisss)\
**Post date:** [October 10, 2018, 9:38am UTC](https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319/1 "2018-10-10T09:38:14Z")

</div>

Hey so I’m trying to make a code that basically is made up of all the states in australia, so when i hover over the (image) i’ve input into the code (one image for each state) they will change colour.

what is the easest way to do that

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 14, 2018, 5:37am UTC](https://discourse.processing.org/t/hovering-over-an-image-and-changing-colour/4319/2 "2018-10-14T05:37:01Z")

</div>

One way is to loop through the images to draw them and, if the mouse is over an image, use `tint()` before and `noTint()` after to colorize it.

[https://processing.org/reference/tint\_.html](https://processing.org/reference/tint_.html)

If you are working with a set of irregular shapes and need collision information on them, you could use the Picking library

> **[nclavaud/picking](https://github.com/nclavaud/picking)**
>
> Processing Library Template for Eclipse. Contribute to nclavaud/picking development by creating an account on GitHub.
