The webcolorconverter class converts the predefined color name or RGB color value to the system. Drawing...:. Color object.
WebcolorconverterClass is used to convert the system. Drawing...:. Color object to a predefined color name or RGB color value. It is also used to convert a predefined color name or RGB color value to a system. Drawing...:. Color object.
The following list contains 16 predefined HTML color names:
Black
Blue
Cyan
Gray
Green
Light Green
Magenta
Purple-red
Navy blue
Olive
Purple
Red
Silver
Blue-green
White
Yellow
You can also use# RrggbbFormat: Specify the custom color with a hexadecimal number after the # sign.Rr,GgAndBbThe hexadecimal values from 0 to 255. These values indicate the red, green, and blue colors respectively. For example# 0000ffIt indicates blue. It specifies the minimum value (00), And specify the maximum value for the blue component (FF).
Above is MSN original, http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webcolorconverter_methods.aspx
System. Web. UI. webcontrols. webcolorconverter contovercolor = new webcolorconverter ();
System. Drawing. Color blcolor = (system. Drawing. Color) contovercolor. convertfrom ("#2787a0 ");
System. Drawing. Color bgcommanycolor = (system. Drawing. Color) contovercolor. convertfrom ("# 9c2d2a ");
System. Drawing. Color departmentscolor = new system. Drawing. color ();