I have table with colors 0 to 254.
I do X number of iterations and in each iteration I pick X-color. So for example in iteration 0 I pick color[0] and in iteration 4 I use color[4].
Its fine when there are 256 iterations. Problem is when I want for example 1000 iterations. I want to still pick colors from 0 - 255. They can be the same for iterations near each other for example 1,1,2,2,3,3,4,4 ... 254.254. I don't want to wrap it with modulo. Like: x = c mod 255;
All iterations (no matter how many) must get colors from 0 to 254.
I think its a problem of mapping point from 1 dimension to another. Re-size the range if you will.
Function could be like this:
int getColor(int iteration, int iterations_count)