WebColorConverter Class
Collapse the table of content
Expand the table of content

WebColorConverter Class

Converts a predefine color name or an RGB color value to and from a System.Drawing.Color.

For a list of all members of this type, see WebColorConverter Members.


[Visual Basic]
Public Class WebColorConverter
   Inherits ColorConverter
public class WebColorConverter : ColorConverter
public __gc class WebColorConverter : public ColorConverter
public class WebColorConverter extends ColorConverter

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The WebColorConverter class to used to convert a System.Drawing.Color to a predefine color name or an RGB color value. It is also used to convert a predefine color name or an RGB color value to a System.Drawing.Color.

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 base class.

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.


Namespace: System.Web.UI.WebControls

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

WebColorConverter Members | System.Web.UI.WebControls Namespace | System.ComponentModel.TypeDescriptor | System.ComponentModel.TypeConverter

© 2016 Microsoft