starting to implement hidden "hit region" canvas

Trying out the idea of implementing a separate "hit region" canvas, where all of the different shapes I'd like to be detected will be drawn in a distinct color.  That way, for any x,y value of the mouse on the real canvas, I can check the corresponding color of that point on the hit canvas, and get what region of the actual canvas the mouse is currently in.

I need to figure out a good way to map though (maybe each of the three elements has one of the three rgb values as 0, so I can quickly check what large-scale region I'm in?). Also, need to have some sort of map object, so that once I have the color, I can immediately get the region/image I want to use.