The following application creates a canvas with four rectangles, and changes the color of the one that is closest to the mouse pointer:
The following application creates a canvas with four rectangles, and changes the color of the one that is closest to the mouse pointer: