DrawingExtensions

Ecng.Drawing

Provides extension methods for converting between integer, HTML color string representations and Color.

Métodos

ToColor
public static Color ToColor(int argb)
result = DrawingExtensions.ToColor(argb)

Creates a Color from the specified ARGB integer.

argb
An integer representing the ARGB value.

Devuelve: A Color corresponding to the ARGB value specified.

ToColor
public static Color ToColor(string htmlColor)
result = DrawingExtensions.ToColor(htmlColor)

Converts an HTML color representation to a Color.

htmlColor
A string representing the HTML color. Accepts formats such as "#RRGGBB", "#RGB" or the special case "LightGrey".

Devuelve: A Color corresponding to the HTML color provided.

ToHtml
public static string ToHtml(Color color)
result = DrawingExtensions.ToHtml(color)

Converts a Color to its HTML representation.

color
The Color to convert.

Devuelve: A string representing the HTML color value. Returns an empty string if the color is empty.