Well, there is a factory static method
System.Drawing.Color.FromName
, please see, but it can only work if the string parameter is equal to the name of one of predefined colors. The colors are enumerated in the type
System.Drawing.KnownColor
. This will construct an instance of
System.Drawing.Color
structure.
See:
http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.drawing.knowncolor.aspx[
^].
However, this is not you may really need. Please see my comment to the question.
Even though it works, this is unreliable: how can you guarantee valid color names all the time? What if software definitions change with time and your database data will survive? Is it all about storing the color in data base? It could be much better to store separate A, R, G, B or just R, G, B components of the color, or a color in one hexadecimal string which you would parse into A, R, G, B. This is how colors are represented in CSS (see); so you can use that format or something like that — see
http://www.w3schools.com/cssref/css_colors.asp[
^].
—SA