Example:
# Instantiating a Workbook object workbook = Workbook() cells = workbook.getWorksheets().get(0).getCells() cells.get("A1").putValue("Hello World") style = cells.get("A1").getStyle() # Set ThemeColorType.Text2 color type with 40% lighten as the font color. style.getFont().setThemeColor(ThemeColor(ThemeColorType.TEXT_2, 0.4)) style.setPattern(BackgroundType.SOLID) # Set ThemeColorType.Background2 color type with 75% darken as the foreground color style.setForegroundThemeColor(ThemeColor(ThemeColorType.BACKGROUND_2, -0.75)) cells.get("A1").setStyle(style) # Saving the Excel file workbook.save("Book1.xlsx")
Constructor Summary |
---|
ThemeColor(type, tint)
|
Property Getters/Setters Summary | ||
---|---|---|
method | getColorType() | |
method | setColorType(value) | |
Gets and sets the theme type. The value of the property is ThemeColorType integer constant. | ||
method | getTint() | |
method | setTint(value) | |
Gets and sets the tint value. |
ThemeColor(type, tint)
type: int
- A tint: float
- The tint value.int getColorType() / setColorType(value)
float getTint() / setTint(value)