Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

...

Wiki Markup
{description}
{excerpt}The {msdn:System.Drawing.Color

...

|Color} class represents a single color in a spreadsheet's color palette.

...

Signature
C#C#
 {excerpt}
{signature:C#}
 public sealed class Color
Signature
{signature}{signature:vb.net
vb.net
}
Public NotInheritable Class Color
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. To get a Color object, use Workbook.Palette to get to the Workbook's palette, then use one of the Palette's methods to get a Color.

{signature}
{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. To get a {{Color}} object, use [Workbook.Palette] to get to the Workbook's palette, then use one of the Palette's methods to get a {{Color}}.
{remarks}
{example}{code:csharp|title=C#}

ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Palette p = wb.Palette;
SoftArtisans.OfficeWriter.ExcelApplication.Color clr =
    p.GetClosestColor(System.Drawing.Color.Blue);
{code}
{code:vbnet|title=vb.net
}

Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim p As Palette = wb.Palette()
Dim clr As SoftArtisans.OfficeWriter.ExcelApplication.Color = _
    p.GetClosestColor(System.Drawing.Color.Blue)
Example
Code Block
csharpcsharp
titleC#
Code Block
vbnetvbnettitle
Properties

...

Name

...

Description

...

Blue

...

{code}

{example}
{properties}
||Name||Description||
|[Blue|Color.Blue]|{excerpt-include:Color.Blue

...

Green

|nopanel=true}|
|[Green|Color.Green]|{excerpt-include

...

:Color.Green

...

IsCustomColor

|nopanel=true}|
|[IsCustomColor|Color.IsCustomColor]|{excerpt-include

...

:Color.IsCustomColor

...

IsPaletteColor

|nopanel=true}|
|[IsPaletteColor|Color.IsPaletteColor]|{excerpt-include

...

:Color.IsPaletteColor

...

IsSystemColor

|nopanel=true}|
|[IsSystemColor|Color.IsSystemColor]|{excerpt-include

...

:Color.IsSystemColor

...

PaletteIndex

|nopanel=true}|
|[PaletteIndex|Color.PaletteIndex]|{excerpt-include

...

:Color.PaletteIndex

...

Red

|nopanel=true}|
|[Red|Color.Red]|{excerpt-include

...

:Color.Red

...

Methods

...

Name

...

Description

...

ToString()

...

|nopanel=true}|
{methods}
||Name||Description||
|[ToString()|Color.ToString()

...

]|{excerpt-include:Color.ToString()

...

|nopanel

...

Classes

...

Name

...

Description

...

SystemColor

...

=true}|
{classes}
||Name||Description||
|[SystemColor|Color.SystemColor]|{excerpt-include:Color.SystemColor

...

|nopanel=true}|