Constructing colours for maximum contrast

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2010-04-22T00:33:31Z Indexed on 2010/04/22 0:43 UTC
Read the original article Hit count: 259

I want to draw some items on screen, each item is in one of N sets. The number of sets changes all the time, so I need to calculate N different colours which are as different as possible (to make it easy to identify what is in which set).

So, for example with N = 2 my results would be black and white. With three I guess I would get all red, all green, all blue. For all four, it's less obvious what the correct answer is, and this is where I'm having trouble.

© Stack Overflow or respective owner

Related posts about colour

Related posts about language-agnostic