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 | 
|---|---|
| System.Xml.XmlNode | 
_initMethod
Init method
Declaration
protected Action _initMethod
  Field Value
| Type | Description | 
|---|---|
| System.Action | 
_nameSpaceManager
Namespace manager
Declaration
protected XmlNamespaceManager _nameSpaceManager
  Field Value
| Type | Description | 
|---|---|
| System.Xml.XmlNamespaceManager | 
_path
The x-path
Declaration
protected string _path
  Field Value
| Type | Description | 
|---|---|
| System.String | 
_pathNode
The node of the supplied path
Declaration
protected XmlNode _pathNode
  Field Value
| Type | Description | 
|---|---|
| System.Xml.XmlNode | 
_schemaNodeOrder
Order of the elements according to the xml schema
Declaration
protected string[] _schemaNodeOrder
  Field Value
| Type | Description | 
|---|---|
| System.String[] | 
_topNode
The top node
Declaration
protected XmlNode _topNode
  Field Value
| Type | Description | 
|---|---|
| System.Xml.XmlNode | 
Properties
ColorType
The type of color.
Each type has it's own property and set-method.
SetRgbColor(Color, Boolean)
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 | 
|---|---|---|
| System.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 | 
|---|---|---|
| System.Double | hue | The hue angle. From 0-360  | 
      
| System.Double | saturation | The saturation percentage. From 0-100  | 
      
| System.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 | 
|---|---|---|
| System.Drawing.Color | color | Color  | 
      
SetRgbColor(Color, Boolean)
Sets a rgb color.
Declaration
public void SetRgbColor(Color color, bool setAlpha = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Drawing.Color | color | The color  | 
      
| System.Boolean | 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 | 
|---|---|---|
| System.Double | redPercentage | Red percentage  | 
      
| System.Double | greenPercentage | Green percentage  | 
      
| System.Double | bluePercentage | Bluepercentage  | 
      
SetSystemColor(eSystemColor)
Sets a system color
Declaration
public void SetSystemColor(eSystemColor systemColor)
  Parameters
| Type | Name | Description | 
|---|---|---|
| eSystemColor | systemColor | The colors  |