Re: Unique Set of n Colors
Re: Unique Set of n Colors
- Subject: Re: Unique Set of n Colors
- From: Steve Israelson <email@hidden>
- Date: Mon, 23 Jul 2007 13:11:41 -0700
Maybe use HSL colors?
The hue angle can be divided into distinct angles.
Start at 0, add 60 + some offset depending on how many you have.
Once you use up all possible angles, change the saturation.
On 23-Jul-07, at 1:00 PM, I. Savant wrote:
List:
I need to generate a set of n unique colors for use in a pie chart.
The set of colors must be unique and sufficiently distinct whether n=1
or n=100 (I realize the higher the 'n', the less distinct the colors
will be). The colors must also be distributed such that red and
slightly-darker-red aren't right next to one-another.
Further, the set of colors cannot be randomly generated. This is the
problem I'm running into with the examples I've been able to google so
far; the set of colors must be exactly the same for n from one run to
the next. Randomizing the channels fails my requirements as I have a
rather strict storage space requirement and an integer representing a
"color scheme" or "mode" is far nicer than a set of up to 100 colors
for each pie chart the user cranks out.
I've spent a good hour googling around, trawling the cocoa-dev
archives, etc. but cannot find a good approach. This, of course, is
after spending *more* hours trying to develop something on my own that
looks good, but to no avail.
Do any of you graphics guys / gals have anything useful or know of
any good examples or open-source projects that do something similar?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden