Is there a way to divide a given rectangle in tikz into n times k equal cells and give a list of coordinates (n\_i,k\_i) of cells, which should get a colored background?

Edit:

I think I should describe a bit more explicit, what I want:

I want a function `\myrec` such that for example:

`\myrec{(0,0),(4.2,6.7),(3,1)}`

draws a rectangle from starting point (0,0) with height=4.2 and width=6.7 which is equally divided like this:

![Rectangle 3x1](https://i.stack.imgur.com/Gg6Mb.jpg)

or 

`\myrec{(0,0),(4.2,6.7),(3,2)}`

a rectangle like this:

![Rectangle 3x2](https://i.stack.imgur.com/fXPQ8.jpg)

Now lets count the cells in such a divided rectangle from the corner on the left below, then I want to be able to give the (i,k)'s cell some color, 

for example

`\myrec[(1,2),(3,1),blue]{(0,0),(4.2,6.7),(3,2)}`

should give something like this:

![Rectangle 3x2 colored](https://i.stack.imgur.com/YpmCe.jpg)

Is sufficient to give each colored cell the same color.