jeremyduj
asked on
Color generator ASP.NET
Is there a asp.net random color generator function or .dll that I can include in my project that I can refer to create a randomly generated HTML color?
For instance, I'd like to be able to do this (if it existed):
ColorGenerator myColorGenerator = new ColorGenerator();
string color = myColorGenerator.getColor( ); //returns a random HTML hex color code
For instance, I'd like to be able to do this (if it existed):
ColorGenerator myColorGenerator = new ColorGenerator();
string color = myColorGenerator.getColor(
If that doesn't work check this.
http://steveorr.net/articles/ImproveYourImages.aspx
Create 3 random numbers from 2 to 255 (R,G,B)
than create color from these three.
http://steveorr.net/articles/ImproveYourImages.aspx
Create 3 random numbers from 2 to 255 (R,G,B)
than create color from these three.
Tested and working
Insert System.Drawing
And this much.
Random random = new Random();
int R = random.Next(225);
int G = random.Next(225);
int B = random.Next(225);
Color RandomColor = Color.FromArgb(R,G,B);
Insert System.Drawing
And this much.
Random random = new Random();
int R = random.Next(225);
int G = random.Next(225);
int B = random.Next(225);
Color RandomColor = Color.FromArgb(R,G,B);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Easy way to get HTML colors:
ColorTranslator.ToHtml(Col or.Red)
Bob
ColorTranslator.ToHtml(Col
Bob
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=757357&SiteID=1
Hope it helps