public class ThemeColor
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").putValue("Hello World");
Style style = cells.get("A1").getStyle();
//Set ThemeColorType.Text2 color type with 40% lighten as the font color.
style.getFont().setThemeColor(new ThemeColor(ThemeColorType.TEXT_2, 0.4));
style.setPattern(BackgroundType.SOLID);
//Set ThemeColorType.Background2 color type with 75% darken as the foreground color
style.setForegroundThemeColor(new ThemeColor(ThemeColorType.BACKGROUND_2, -0.75));
cells.get("A1").setStyle(style);
//Saving the Excel file
workbook.save("book1.xlsx");
| Constructor and Description |
|---|
ThemeColor(int type,
double tint) |
| Modifier and Type | Method and Description |
|---|---|
int |
getColorType()
Gets the theme type.
|
double |
getTint()
Gets the tint value.
|
void |
setColorType(int value)
Sets the theme type.
|
void |
setTint(double value)
Sets the tint value.
|
public ThemeColor(int type,
double tint)
type - ThemeColorType. The theme type.tint - The tint value.public int getColorType()
See ThemeColorType.
public void setColorType(int value)
See ThemeColorType.
public double getTint()
Remarks
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.public void setTint(double value)
Remarks
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.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.