[]
Provides utility methods for working with colors.
This class converts color strings into Color objects that can be used in workbook APIs such as cell fill and border formatting. Use StringToColor(string) to create colors from standard color names, RGB and RGBA expressions, and hexadecimal color strings.
public static class ColorUtilities
Public Module ColorUtilities
Color fillColor = ColorUtilities.StringToColor("rgba(255,0,0,0.5)");
Color borderColor = ColorUtilities.StringToColor("#000000");
worksheet.Range["B2"].Interior.Color = fillColor;
worksheet.Range["B2"].Borders.Color = borderColor;
| Name | Description |
|---|---|
| StringToColor(string) | Converts a color string to a Color object.
Supported formats include RGB expressions such as If the input cannot be parsed, this method returns a fully transparent color. |