views:

6488

answers:

7

I'm looking for a simple algorithm to generate a large number of random, aesthetically pleasing colors. So no crazy neon colors, colors reminiscent of feces, etc.

I've found solutions to this problem but they rely on alternative color palettes than RGB. I would rather just use straight RGB than mapping back and forth. These other solutions also can at most generate only 32 or so pleasing random colors.

Any idea's would be great.

Thanks, Brian Gianforcaro

A: 

you could have them be within a certain brightness. that would control the ammount of "neon" colors a bit. for instance, if the "brightness"

brightness = sqrt(R^2+G^2+B^2)

was within a certain high bound, it would have a washed out, light color to it. Conversely, if it was within a certain low bound, it would be darker. This would eliminate any crazy, standout colors and if you chose a bound really high or really low, they would all be fairly close to either white or black.

contagious
+1  A: 

There is a pretty cool creation by Eric Meyer, which will blend 2 endpoint colors in N even steps http://meyerweb.com/eric/tools/color-blend/, this is under a CC License, and could be a good starting point.

seanb
Exactly what I was looking for! Thanks.
BioGeek
A: 

It's going to be hard to get what you want algorithmically - people have been studying color theory for a long time, and they don't even know all the rules.

However, there are some rules which you can use to cull bad color combinations (ie, there are rules for clashing colors, and choosing complementary colors).

I'd recommend you visit your library's art section and check out books on color theory to gain a better understanding of what is a good color before you try to make one - it appears you might not even know why certain combinations work and others don't.

Adam Davis
+2  A: 

might want to check out something like color jack which was intended for generating website color templates

DShook
+39  A: 
David Crow
+1 for 'ran the code'
David Dean
That's pretty impressive
Michael Haren
Exactly what i'm looking for.
Donblas
+1  A: 

I'd make a website that generates a random color upon each visit. Have a "this color rocks" / "this color sucks" vote.

Then sort by the ratio of votes.

Nosredna
A: 

Converting to another palette is a far superior way to do this. There's a reason they do that: other palettes are 'perceptual' - that is, they put similar seeming colors close together, and adjusting one variable changes the color in a predictable manner. None of that is true for RGB, where there's no obvious relationship between colors that "go well together".

Nick Johnson