Sprite sheet scheme for a three-style grid in AndEngine

view story

http://stackoverflow.com – I am working in some game idea with Android and AndEngine, but I can't find a good tiling approach. Some part of the game will consist on a rectangular grid. Three "styles" are possible, for each square side of the grid or the inner square. For simplicity we can think about gray, blue and red. The problem is, when I think about making the sprite sheet, I'm not sure how to do it. This is a quick (and bad drawing) of my first thoughts, being black the grid and green the cuts. Problem with this one is I would need to have up to 512 versions of the line crossing. Is there a better approach? (HowTos)