.NET - Converting Color Name Strings into System.Drawing.Color

BuddyJoe picture BuddyJoe · Feb 23, 2009 · Viewed 30.2k times · Source

What is the best way to turn strings like "red", "green", "yellow", "aliceblue", etc... into the actual System.Drawing.Color value?

I was looking at reflection and something about that didn't seem right.

Answer

Alex Reitbort picture Alex Reitbort · Feb 23, 2009

You can use Color.FromName()