XlColor.FromTheme(XlThemeColor, Double) Method

Creates the XlColor object from the theme color using the specified saturation value.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v21.1.Core.dll


public static XlColor FromTheme(
    XlThemeColor themeColor,
    double tint


Name Type Description
themeColor XlThemeColor

An XlThemeColor enumeration member that is one of 12 base colors used by the current document theme.

tint Double

A Double value from -1 to 1.

If a value is outside the allowable range of values, the ArgumentOutOfRangeException will be thrown.


Type Description

An XlColor class instance.


The tint parameter value specifies shades (negative values) or tints (positive values) used to darken or lighten the original color, respectively. -1.0 means darken 100% (black) and 1.0 means lighten 100% (white). The zero value corresponds to the original color used at full strength.

The example below demonstrates how to fill the cell background using the color that is 20% lighter than the standard Accent 1 color of the default Office 2013 theme. The XlDocumentTheme enumeration lists the available document themes.

using (IXlCell cell = row.CreateCell())
    // Fill the cell background using the theme color.
    XlColor color = XlColor.FromTheme(XlThemeColor.Accent1, 0.2);
See Also