Question

I need to assign colours to distinguish between different items. Simple case: order rows of different color according to customer.

I don't want to have the user choose a colour for every customer, I want to do this at runtime.

If there is a single customer I will use "red", if there are two "red" and "white", ...

Of course I can create my GimmeRandomColour(i: index) own function that uses i and the RGB function to create good random colours (but in this case creating nice colours can be tricky). Or I can say if i is 0 give me clRed, ... (in this way creating many colours can be a problem).

How can I get a "good list of colours" with a acceptable levels of contrast?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top