class
ThemeColor
Source: aspose.
Represents a theme color.
new ThemeColor(type, tint)
Example
//Instantiating a Workbook object
var workbook = new aspose.cells.Workbook();
var cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").putValue("Hello World");
var style = cells.get("A1").getStyle();
//Set ThemeColorType.Text2 color type with 40% lighten as the font color.
style.getFont().setThemeColor(new aspose.cells.ThemeColor(aspose.cells.ThemeColorType.TEXT_2, 0.4));
style.setPattern(aspose.cells.BackgroundType.SOLID);
//Set ThemeColorType.Background2 color type with 75% darken as the foreground color
style.setForegroundThemeColor(new aspose.cells.ThemeColor(aspose.cells.ThemeColorType.BACKGROUND_2, -0.75));
cells.get("A1").setStyle(style);
//Saving the Excel file
workbook.save("Book1.xlsx");
Parameters
Name | Type | Optional | Description |
---|---|---|---|
type |
|
|
ThemeColorType |
tint |
|
|
The tint value. |
Methods
getColorType()
Gets and sets the theme type. The value of the property is ThemeColorType integer constant.
getTint()
Gets and sets the tint value. The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.
setColorType()
Gets and sets the theme type. The value of the property is ThemeColorType integer constant.
setTint()
Gets and sets the tint value. The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.