Click or drag to resize

Workbook ChangePaletteColor Method

Changes the palette for the spreadsheet in the specified index.
Examples
The following code snippet illustrates how to set palette color:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set palette color</para><para>workbook.ChangePaletteColor(System.Drawing.Color.Red , 10);</para><para>//Set color</para><para>worksheet["B2"].Style.Color = workbook.Colors[10];</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 void ChangePaletteColor(
	Color color,
	int index
)

Parameters

color
Type: System.Drawing Color
Color structure
index
Type: System Int32
Palette index,Value should be from 0 to 55
See Also