well, i don't want to do your work for you, but you could make an int for the current color, and which color was last. you set the current to the last at the beginning, and set last to current at the end (of the main loop, that is) when you call dbRND, put this in a while loop where the condition is the current is not equal to the last. this way, if the loop will execute the first time, because the last var is equal to current because you set it, but as soon as dbRND is called, if it is not the same, it will redo it.
-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm