Get Random Color - CSharp System.Drawing

CSharp examples for System.Drawing:Color

Description

Get Random Color

Demo Code


using System.Drawing;
using System.Text;
using System.Collections.Generic;
using System;//  w  w  w  .j  a  v  a2  s.  c o  m

public class Main{
        public static Color GetRandomColor()
        {
            Random rnd = new Random();
            return Color.FromArgb(rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255));
        }
}

Related Tutorials