Page tree
Skip to end of metadata
Go to start of metadata

Description

The Palette class represents Excel's color palette.

C#
vb.net

Remarks

Each Excel document has a single color palette that manages the colors for formatting and some drawing layer colors. A color palette contains 56 colors that may be referenced. Each of these 56 colors may be customized, but changing a color in the palette will affect all formatting that uses the referenced color. A workbook's color palette is accessible through Workbook.Palette.

Examples

C#
vb.net

Fields

Name

Description

MinColorIndex

The minimum valid index of a color within the palette.

MinRGBValue

The minimum value that an RGB component value may have.

MaxColorIndex

The maximum valid index of a color within the palette.

MaxRGBValue

The maximum value that an RGB component value may have.

Methods

Name

Description

GetClosestColor(Int32, Int32, Int32)

Returns the closest color to the specified RGB value that the file can support.

GetClosestColor(System.Drawing.Color)

Returns the closest color to the specified color that the file can support.

GetColor(Int32, Int32, Int32)

Returns a color representing the specified RGB value, and throws an exception if the file does not support the specified color.

GetColor(System.Drawing.Color)

Returns a Color representing the specified color, and throws an exception if the file does not support the specified color.

GetColorAt(Int32)

Returns the color at the specified 0-based index within the Palette.

SetColor(Color, Int32, Int32, Int32)

Changes the RGB value of a specified Color object, and updates all objects referencing that color.

SetColorAt(Int32, Int32, Int32, Int32)

Replaces the color at the specified index in the palette with a new color.

Nested Classes

Name

Description

SystemColor

Primary System Colors
  • No labels