Advertisement
Guest User

Generating a Random Color in C#

a guest
Sep 2nd, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. //This method returns a color that
  2. //is made with random R, G, and B values
  3. public Color getRandomColor()
  4. {
  5.      Random random = new Random();
  6.      return Color.FromArgb(random.Next(256), random.Next(256), random.Next(256));
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement