Is this possible? (Finger drag)

In my app, I currently have a grid of 25 buttons (5 rows x 5 columns).
When I click a button the background color changes to a "master" color I have set.
Everything works fine, but the buttons are not really what I want.
This is what I want to do:
I want a grid of 5 rows and 5 columns which, when I touch and/or drag my finger across the screen the background color of each square touched in the grid will change to my master color (i.e., without lifting my finger and tapping each square separately, like I have to do with the buttons).
Then, elsewhere I want to read the color information from the grid (i.e, the background color of each square).
Is this possible, and how would I achieve it?

Using the math floor block and a little arithmetic, you can turn x,y into row,column while you drag.

Sample app:

This is possible using canvas. You can draw a grid of buttons on the canvas. Then, while dragging, you can change the colors by redrawing everything. You can also use the canvas like buttons. But it is actually the method that Abraham presented.

Thanks, that's great and nice to know that it can be done. However, at this time I think it is a little above my AI skill level. Perhaps I will revisit it in the future.