Do you know any random color generation method ( not a random color name !)?
I already have one, but it is not doing it right:
This only returns green:
Random r = new Random();
BackColor = Color.FromArgb(r.Next(0, 256), r.Next(0, 256), 0);
This only returns red:
Random r = new Random();
BackColor = Color.FromArgb(r.Next(0, 256), 0, 0);
This returns only blue color:
Random r = new Random();
BackColor = Color.FromArgb(0, 0, r.Next(0, 256));
I want my code to return a single, random color, and not just green / red / blue every time, as the above do.
How to solve this?
Any suggestion will be approved with pleasure!
source
share