Try and think of it as a three dimensional cube. Basically what you are doing here is bouncing off the walls but always traveling at a fixed rate along an axis.

You can make that rate of change a random number.

You could generate two random points in this space and then step between these two points.

You can generate a random triplet and show it with each of the components in turn missing (that is no red, then no green, then no blue)

Finally you can explore other colour spaces like HVS colour space and bounce around in that.

Hope that gives you some ideas.