WebColorConverter Class
Converts a predefined color name or an RGB color value to and from a System.Drawing::Color object.
Assembly: System.Web (in System.Web.dll)
The WebColorConverter class is used to convert a System.Drawing::Color object to a predefined color name or an RGB color value. It is also used to convert a predefined color name or an RGB color value to a System.Drawing::Color object.
Caution: |
|---|
You should never access a type converter directly. Instead, call the appropriate converter by using System.ComponentModel::TypeDescriptor. For more information, see the examples in the System.ComponentModel::TypeConverter class overview. |
The following list contains the sixteen predefined HTML color names you can use:
Black
Blue
Cyan
Gray
Green
Lime
Magenta
Maroon
Navy
Olive
Purple
Red
Silver
Teal
White
Yellow
You can also specify a custom color by using a hexadecimal number, preceded by the pound character (#), in the form #RRGGBB. RR, GG, and BB represent hexadecimal values from 0 to 255 that indicate the red, green, and blue components of a color, respectively. For example, the value #0000FF represents the color blue. It specifies the minimum value (00) for the red and green components, while specifying the maximum value (FF) for the blue component.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.ComponentModel::TypeConverter
System.Drawing::ColorConverter
System.Web.UI.WebControls::WebColorConverter
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Caution: