Algorithm to randomly generate an aesthetically-pleasing color palette?

You could average the RGB values of random colors with those of a constant color.

You could average the RGB values of random colors with those of a constant color: (example in Java) public Color generateRandomColor(Color mix) { Random random = new Random(); int red = random. NextInt(256); int green = random. NextInt(256); int blue = random.

NextInt(256); // mix the color if (mix! = null) { red = (red + mix.getRed()) / 2; green = (green + mix.getGreen()) / 2; blue = (blue + mix.getBlue()) / 2; } Color color = new Color(red, green, blue); return color; } Mixing random colors with white (255, 255, 255) creates neutral pastels by increasing the lightness while keeping the hue of the original color. These randomly generated pastels usually go well together, especially in large numbers.

Here are some pastel colors generated using the above method: You could also mix the random color with a constant pastel, which results in a tinted set of neutral colors. For example, using a light blue creates colors like these: Going further, you could add heuristics to your generator that take into account complementary colors or levels of shading, but it all depends on the impression you want to achieve with your random colors. Some additional resources: http://en.wikipedia.org/wiki/Color_theory http://en.wikipedia.org/wiki/Complementary_color.

1 for 'ran the code' – David Dean Feb 22 '09 at 9:45 1 That's pretty impressive – Michael Haren Jun 7 '09 at 2:02 Exactly what i'm looking for. – Donblas Oct 22 '09 at 0:52.

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".

I would use a color wheel and given a random position you could add the golden angle (137,5 degrees) en.wikipedia.org/wiki/Golden_angle in order to get different colours each time that do not overlap. Adjusting the brightness for the color wheel you could get also different bright/dark color combinations. I've found this blog post that explains really well the problem and the solution using the golden ratio.

martin.ankerl.com/2009/12/09/how-to-crea....

2 Thanks for the link to this excellent article! Maybe I am biased because I wrote it ;) – martinus Mar 12 at 14:18.

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

Exactly what I was looking for! Thanks. – BioGeek Oct 24 '10 at 15:11.

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

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.

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.

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.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions