I’m making this game on .NET (link: http://www.bubblebox.com/play/puzzle/539.htm ). Everything is fine, except that I don’t know how to generate a level that can be solved within N turns. A similar game on Google+ is Flood Fill, but they’re square, not hexagon.
EDIT: Here’s the explanation about this kind of game: https://www.youtube.com/watch?v=QihKrPLb8e8&feature=player_embedded . Mad Virus is similar, but it has hexagon grid instead, and the number of step is not constant, it increases as the difficulty increases.
Start from the end result and work backwards.
By the nth turn the grid should be uniformly one colour, so start there. Then pick a connected region of the grid (which contains the top left hexagon) and fill it with some colour. By repeating this process n times you will obtain a grid that can be solved in n turns.
The colours for each turn should be chosen at random, with the proviso that the same colour should not be chosen twice in a row. It may turn out that weighting the random choice by how recently each colour has been chosen.
The algorithm to randomly choose each region should (on average) make each region smaller than the last. It could try to maintain at least one hexagon from each previous fill process. I suggest you try a few algorithms for area selection, and play test the results.
This process gives you an upper bound on the fastest solution. The only way I can think to verify the actual minimum number of turns required, is exhaustive search. Personally I think this sounds like overkill for a level generation algorithm like this. With an algorithm of the above form, the number of turns will increase heuristically (until n is equal to the fastest solution to the most complex grid).