Message-ID: <128160978.9907.1711706426380.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9906_1657225624.1711706426380" ------=_Part_9906_1657225624.1711706426380 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Palette

Palette

Description

=20

The Palette class represents Excel= 's color palette.

=20
C#
=20
 public sealed class Palette
=20
=20
vb.net
=20
Public NotInheritable Class Palette
=20
=20

Remarks

Each Excel document has a single co= lor palette that manages the colors for formatting and some drawing layer c= olors. A color palette contains 56 colors that may be referenced. Each of t= hese 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 pa= lette is accessible through=20 Workbook.Palett= e.=20

Examples

=20
C#
=20

          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Palette pal =3D wb.Palette;
        
=20
=20
vb.net
=20

          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim pal As Palette =3D wb.Palette
        
=20
=20

Fields

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

MinColorIndex

The minimum valid index of a color within the pa= lette.

MinRGBValue

The minimum value that an RGB component value ma= y have.

MaxColorIndex

The maximum valid index of a color within the pa= lette.

MaxRGBValue

The maximum value that an RGB component value ma= y have.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

GetClosestColor(Int32, Int32, Int32)

Returns the closest color to the specified RGB v= alue 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 v= alue, and throws an exception if the file does not support the specified co= lor.

GetColor(System.Drawing.Color)

Returns a Color<= /a> representing the specified color, and throws an exception if the file d= oes 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.
=20

Nested Classes

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

SystemColor

Primary System Colors
------=_Part_9906_1657225624.1711706426380--