Table of Contents

Class DrawingExtensions

Namespace
Ecng.Drawing
Assembly
Ecng.Drawing.dll

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

public static class DrawingExtensions
Inheritance
DrawingExtensions
Inherited Members

Methods

ToColor(int)

Creates a Color from the specified ARGB integer.

public static Color ToColor(this int argb)

Parameters

argb int

An integer representing the ARGB value.

Returns

Color

A Color corresponding to the ARGB value specified.

ToColor(string)

Converts an HTML color representation to a Color.

public static Color ToColor(this string htmlColor)

Parameters

htmlColor string

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

Returns

Color

A Color corresponding to the HTML color provided.

ToHtml(Color)

Converts a Color to its HTML representation.

public static string ToHtml(this Color color)

Parameters

color Color

The Color to convert.

Returns

string

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