I'm writing an asp.net
application where I have to accomplish following 2 tasks:
Generate the 'n' number of random colors based on user input 'n'(n is the no of colors user wants to generate).
All generated colors should be solid colors.
Note : I should generate solid colors only, because when I override one color(color_new) on top of another color(color_old), the overridden color(color_old) should not be visible any more.
What I have done:
I Have written following code in C#
(code behind file) for generating random colors and it is working fine.
private Color GenerateNewColor()
{
var values = Guid.NewGuid().ToByteArray().Select(b => (int)b);
int red = values.Take(5).Sum() % 255;
int green = values.Skip(5).Take(5).Sum() % 255;
int blue = values.Skip(10).Take(5).Sum() % 255;
return Color.FromArgb(255,red, green, blue);
}
Here now my question is "How should I ensure that generated color is Solid or not from the above function?"
Thanks in Advance.