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?
For charts and graphs it's a relatively common question by programmers to want to procedurally generate an arbitrary number of colors that are visually distinct. Various research (or educated guesses) exist that say that the number of colors humans can differentiate is somewhere between 200,000 and 20 million.
Use the veins on your wrist to tell if you have cool or warm undertones. Lift your wrist to eye-level in natural light and inspect your veins on the inside of your wrist. If your veins look green or greenish-blue, your skin has warm undertones. If the veins look blue or purple, you have cool undertones.
HTML used to recognize 16 color names ("black", "white", "gray", "silver", "maroon", "red", "purple", "fushsia", "green", "lime", "olive", "yellow", "navy", "blue", "teal", and "aqua"), but new browsers can recognize 147 CSS3 color names. a color number, such as "#FF0000", "#FFFFFF" (those are red and white).
The basic color terms are red, blue, yellow, green, orange, purple, brown, pink, black, gray, and white. The additional colors are merely shades of at least one of the basic colors listed.
No in-built function in Delphi. See this question for ways to generate pleasing colour schemes.
Algorithm to randomly generate an aesthetically-pleasing color palette
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With