Class ColorHelper
A static helper class for color manipulation.
Inheritance
System.Object
ColorHelper
Namespace: IronWord.Models.Extensions
Assembly: IronWord.dll
Syntax
public static class ColorHelper : Object
Methods
ToHex(Color)
Converts a Color object to its hexadecimal representation.
Declaration
public static string ToHex(this Color c)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | c | The Color object to convert. |
Returns
| Type | Description |
|---|---|
| System.String | The hexadecimal representation of the color, including alpha channel. |
Remarks
This method considers the opacity of the color and adjusts the RGB values accordingly. This is essential for ensuring the correct hex code is generated for semi-transparent colors.