Table of Contents

Class ExcelColor

Namespace
OfficeOpenXml.Style
Assembly
EPPlus.dll

Color for cellstyling

public sealed class ExcelColor : StyleBase
Inheritance
ExcelColor
Inherited Members

Properties

Auto

Auto color

public bool Auto { get; }

Property Value

bool

Indexed

The indexed color number. A negative value means not set.

public int Indexed { get; set; }

Property Value

int

Rgb

The RGB value

public string Rgb { get; }

Property Value

string

Theme

The theme color

public eThemeSchemeColor? Theme { get; }

Property Value

eThemeSchemeColor?

Tint

The tint value

public decimal Tint { get; set; }

Property Value

decimal

Methods

LookupColor()

Return the RGB hex string for the Indexed or Tint property

public string LookupColor()

Returns

string

The RGB color starting with a #FF (alpha)

LookupColor(ExcelColor)

Return the RGB value as a string for the color object that uses the Indexed or Tint property

public string LookupColor(ExcelColor theColor)

Parameters

theColor ExcelColor

The color object

Returns

string

The RGB color starting with a #FF (alpha)

SetAuto()

Set the color to automatic

public void SetAuto()

SetColor(eThemeSchemeColor)

Set the color of the object

public void SetColor(eThemeSchemeColor color)

Parameters

color eThemeSchemeColor

The color

SetColor(ExcelIndexedColor)

Set the color of the object

public void SetColor(ExcelIndexedColor color)

Parameters

color ExcelIndexedColor

The color

SetColor(Color)

Set the color of the object

public void SetColor(Color color)

Parameters

color Color

The color

SetColor(int, int, int, int)

Set the color of the object

public void SetColor(int alpha, int red, int green, int blue)

Parameters

alpha int

Alpha component value

red int

Red component value

green int

Green component value

blue int

Blue component value