How to

get color from name

Published: 24. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Converting » Colors
Tags: C# Colors Conversion Winforms WPF
Was this snippet helpful for you? YESYES / NONO

In WPF

using System.Windows.Media;
Color color = ColorConverter.ConvertFromString("Green");

In Winforms

using System.Drawing;
Color color = Color.FromName("Green");
Send us feedback about this snippet »



Related Snippets: