Click or drag to resize

Workbook Colors Property

Returns colors in the palette for the workbook. The palette has 56 entries, each represented by an RGB value. Read/write Object.
Examples
The following code illustrates how to access the default colors of excel color palette:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get colors</para><para>System.Drawing.Color[] colors = workbook.Colors;</para><para>//Get color</para><para>System.Drawing.Color color = colors[2];</para><para>//Set color</para><para>worksheet["B2"].Style.Color = color;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>

Namespace: Spire.Xls
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public Color[] Colors { get; }

Property Value

Type: Color
See Also