[jQuery] change certain elements in result set based on position

[jQuery] change certain elements in result set based on position


Hello all,
I can't quite get my head around how to accomplish this and any
guidance would be greatly appreciated.
Say I have some random number of <h1>'s on the page, like 20. I'd like
to grab the first 4 and make them red, then grab the next 4 and make
them blue, then grab the next 4 and do something else with them, and
so on until I reach the end.
I've been looking at .each() and some of the array functions, but I
can't seem to piece it together.
Thanks,
Michael