Class ExcelDrawingThemeColorManager
Manages colors in a theme
Inherited Members
Namespace: OfficeOpenXml.Drawing.Style.Coloring
Assembly: EPPlus.dll
Syntax
public class ExcelDrawingThemeColorManager
Fields
_colorNode
The node of the color object
Declaration
protected XmlNode _colorNode
Field Value
| Type | Description |
|---|---|
| XmlNode |
_initMethod
Init method
Declaration
protected Action _initMethod
Field Value
| Type | Description |
|---|---|
| Action |
_nameSpaceManager
Namespace manager
Declaration
protected XmlNamespaceManager _nameSpaceManager
Field Value
| Type | Description |
|---|---|
| XmlNamespaceManager |
_path
The x-path
Declaration
protected string _path
Field Value
| Type | Description |
|---|---|
| string |
_pathNode
The node of the supplied path
Declaration
protected XmlNode _pathNode
Field Value
| Type | Description |
|---|---|
| XmlNode |
_schemaNodeOrder
Order of the elements according to the xml schema
Declaration
protected string[] _schemaNodeOrder
Field Value
| Type | Description |
|---|---|
| string[] |
_topNode
The top node
Declaration
protected XmlNode _topNode
Field Value
| Type | Description |
|---|---|
| XmlNode |
Properties
ColorType
The type of color.
Each type has it's own property and set-method.
SetRgbColor(Color, bool)
SetRgbPercentageColor(double, double, double)
SetHslColor(double, double, double)
SetPresetColor(Color)
SetPresetColor(ePresetColor)
SetSystemColor(eSystemColor)
SetSchemeColor(eSchemeColor)
Declaration
public eDrawingColorType ColorType { get; protected set; }
Property Value
| Type | Description |
|---|---|
| eDrawingColorType |
HslColor
A hsl color. This property has a value when Type is set to Hsl
Declaration
public ExcelDrawingHslColor HslColor { get; }
Property Value
| Type | Description |
|---|---|
| ExcelDrawingHslColor |
PresetColor
A preset color. This property has a value when Type is set to Preset
Declaration
public ExcelDrawingPresetColor PresetColor { get; }
Property Value
| Type | Description |
|---|---|
| ExcelDrawingPresetColor |
RgbColor
A rgb color. This property has a value when Type is set to Rgb
Declaration
public ExcelDrawingRgbColor RgbColor { get; }
Property Value
| Type | Description |
|---|---|
| ExcelDrawingRgbColor |
RgbPercentageColor
A rgb precentage color. This property has a value when Type is set to RgbPercentage
Declaration
public ExcelDrawingRgbPercentageColor RgbPercentageColor { get; }
Property Value
| Type | Description |
|---|---|
| ExcelDrawingRgbPercentageColor |
SystemColor
A system color. This property has a value when Type is set to System
Declaration
public ExcelDrawingSystemColor SystemColor { get; }
Property Value
| Type | Description |
|---|---|
| ExcelDrawingSystemColor |
Transforms
Color transformations
Declaration
public ExcelColorTransformCollection Transforms { get; }
Property Value
| Type | Description |
|---|---|
| ExcelColorTransformCollection |
Methods
ResetColors(string)
Reset the color objects
Declaration
protected virtual void ResetColors(string newNodeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | newNodeName | The new color node name |
SetHslColor(double, double, double)
Sets a hsl color
Declaration
public void SetHslColor(double hue, double saturation, double luminance)
Parameters
| Type | Name | Description |
|---|---|---|
| double | hue | The hue angle. From 0-360 |
| double | saturation | The saturation percentage. From 0-100 |
| double | luminance | The luminance percentage. From 0-100 |
SetPresetColor(ePresetColor)
Sets a preset color.
Declaration
public void SetPresetColor(ePresetColor presetColor)
Parameters
| Type | Name | Description |
|---|---|---|
| ePresetColor | presetColor | The color |
SetPresetColor(Color)
Sets a preset color. Must be a named color. Can't be color.Empty.
Declaration
public void SetPresetColor(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | Color |
SetRgbColor(Color, bool)
Sets a rgb color.
Declaration
public void SetRgbColor(Color color, bool setAlpha = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | The color |
| bool | setAlpha | Apply the alpha part of the Color to the Transforms collection |
SetRgbPercentageColor(double, double, double)
Sets a rgb precentage color
Declaration
public void SetRgbPercentageColor(double redPercentage, double greenPercentage, double bluePercentage)
Parameters
| Type | Name | Description |
|---|---|---|
| double | redPercentage | Red percentage |
| double | greenPercentage | Green percentage |
| double | bluePercentage | Bluepercentage |
SetSystemColor(eSystemColor)
Sets a system color
Declaration
public void SetSystemColor(eSystemColor systemColor)
Parameters
| Type | Name | Description |
|---|---|---|
| eSystemColor | systemColor | The colors |