# Map regions as a button

**URL:** <https://forum.inductiveautomation.com/t/map-regions-as-a-button/1409>\
**Category:** Archived Topics\
**Created:** [December 15, 2009, 9:37pm UTC](https://forum.inductiveautomation.com/t/map-regions-as-a-button/1409 "2009-12-15T21:37:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [December 18, 2009, 3:47pm UTC](https://forum.inductiveautomation.com/t/map-regions-as-a-button/1409/5 "2009-12-18T15:47:16Z")

</div>

You can get the colour of the point you click on by including the following code in an object’s mouseClicked event:`import java.awt.Robot
robot = java.awt.Robot()
x = event.x + event.source.getLocationOnScreen().x
y = event.y + event.source.getLocationOnScreen().y
colour = robot.getPixelColor(x, y)`Can I get my ‘Clever Scripter’ badge now please? 🙂

---

_[View the full topic](https://forum.inductiveautomation.com/t/map-regions-as-a-button/1409)._
