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.
System.Drawing.Color has a static method:
public static Color FromName(string name)
Use it like so:
Color c = Color.FromName("AliceBlue")
You can use Color.FromName()
System.Drawing.Color.FromName("Red");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With