Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

The

Msdn
System.Drawing.Color

...

System.Drawing.Color
1Color
class represents a single color in a spreadsheet's

...

color

...

palette.

...

Signature
C#
C#
 public sealed class Color
{signature}{signature:
}
Signature
vb.net
vb.net
Public NotInheritable Class 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#}
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.

Example
Code Block
csharp
csharp
titleC#


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=
Code Block
vbnet
vbnet
titlevb.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)
{code} {example} {properties} ||Name||Description|| |[Blue|Color.Blue]|{excerpt-include:Color.Blue|nopanel=true}| |[Green|Color.Green]|{excerpt-include:Color.Green|nopanel=true}| |[IsCustomColor|Color.IsCustomColor]|{excerpt-include:Color.IsCustomColor|nopanel=true}| |[IsPaletteColor|Color.IsPaletteColor]|{excerpt-include:Color.IsPaletteColor|nopanel=true}| |[IsSystemColor|Color.IsSystemColor]|{excerpt-include:Color.IsSystemColor|nopanel=true}| |[PaletteIndex|Color.PaletteIndex]|{excerpt-include:Color.PaletteIndex|nopanel=true}| |[Red|Color.Red]|{excerpt-include:Color.Red|nopanel=true}| {methods} ||Name||Description|| |[ToString()|Color.ToString()]|{excerpt-include:Color.ToString()|nopanel=true}| {classes} ||Name||Description|| |[SystemColor|Color.SystemColor]|{excerpt-include:Color.SystemColor|nopanel=true}|
Properties

Name

Description

Blue

Excerpt Include
Color.Blue
Color.Blue
nopaneltrue

Green

Excerpt Include
Color.Green
Color.Green
nopaneltrue

IsCustomColor

Excerpt Include
Color.IsCustomColor
Color.IsCustomColor
nopaneltrue

IsPaletteColor

Excerpt Include
Color.IsPaletteColor
Color.IsPaletteColor
nopaneltrue

IsSystemColor

Excerpt Include
Color.IsSystemColor
Color.IsSystemColor
nopaneltrue

PaletteIndex

Excerpt Include
Color.PaletteIndex
Color.PaletteIndex
nopaneltrue

Red

Excerpt Include
Color.Red
Color.Red
nopaneltrue
Methods

Name

Description

ToString()

Excerpt Include
Color.ToString()
Color.ToString()
nopaneltrue
Classes

Name

Description

SystemColor

Excerpt Include
Color.SystemColor
Color.SystemColor
nopaneltrue