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

Color

Description

=20

The Color class repres= ents a single color in a spreadsheet's color palette.

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

Remarks

Each Excel document has a single colo= r palette that manages the colors for formatting and some drawing layer col= ors. A color palette contains 56 colors that may be referenced. Each of the= se 56 colors may be customized, but changing a color in the palette will af= fect all formatting that uses the referenced color. To get a=20 Color object, use=20 Workbook.Palette= to get to the Workbook's palette, then use one of the Palette's method= s to get a=20 Color.=20

Examples

=20
C#
=20

ExcelApplication xla =3D new ExcelApplication();
Workbook wb =3D xla.Create();
Palette p =3D wb.Palette;
SoftArtisans.OfficeWriter.ExcelApplication.Color clr =3D
    p.GetClosestColor(System.Drawing.Color.Blue);
=20
=20
vb.net
=20

Dim xla As New ExcelApplication()
Dim wb As Workbook =3D xla.Create()
Dim p As Palette =3D wb.Palette()
Dim clr As SoftArtisans.OfficeWriter.ExcelApplication.Color =3D _
    p.GetClosestColor(System.Drawing.Color.Blue)
=20
=20

Properties

=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

Blue<= /p>

Returns the blue component of the color's RGB va= lue.

Green

Returns the green component of color's the RGB v= alue.

= IsCustomColor

Returns whether or not the color is a custom col= or.

IsPaletteColor

Returns whether or not the color is stored in Ex= cel's default color palette. For .xlsx files, returns whether the color has= been retrieved from the legacy palette. The only way to retrieve colors fr= om the legacy palette is by using the Palette.SetColorAt or Palette.GetColorAt methods.

= IsSystemColor

Returns whether or not the color is a system col= or that cannot be changed.

P= aletteIndex

For palette colors, returns the 0-based index of= the color in the spreadsheet's color palette. For custom colors, this prop= erty will return a negative number. Automatic colors will return an index g= reater than or equal to 56 (the maximum index in the palette).

Red

Returns the red component of the color's RGB val= ue.
=20

Methods

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

Name

Description

ToString()

Returns a string representation of the Color object.
=20

Nested Classes

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

Name

Description

Sy= stemColor

System colors that can be used as colors in Exce= lWriter
------=_Part_8360_1333908919.1711643326782--