[]
• new Theme(name
, colorScheme
, headerFont
, bodyFont
)
Represents a color scheme.
example
//This example creates a new SpreadTheme object.
sheet.getCell(0, 0).backColor("accent 1");
sheet.getCell(1, 0).backColor("accent 6");
$("#btn").click(function () {
var custom = new GC.Spread.Sheets.Theme("Custom");
custom.colors().accent1("red");
custom.colors().accent6("green");
sheet.currentTheme(custom);
})
Name | Type | Description |
---|---|---|
name |
string |
The name of the theme. |
colorScheme |
ColorScheme |
The base colors of the theme color. |
headerFont |
string |
The name of the heading font. |
bodyFont |
string |
The name of the body font. |
▸ bodyFont(value?
): any
Gets or sets the body font of the theme.
example
var custom = new GC.Spread.Sheets.Theme("Custom");
custom.bodyFont('cursive');
sheet.currentTheme(custom);
sheet.setValue(0, 0, 'hello world!'); // The font of the cell will be 'cursive'.
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the body font; otherwise, returns the theme.
▸ colors(value?
): any
Gets or sets the base colors of the theme.
example
var custom = new GC.Spread.Sheets.Theme("Custom");
custom.colors().accent1("red");
custom.colors().accent6("green");
sheet.currentTheme(custom);
sheet.getCell(0, 0).backColor("accent 1"); // The background color of the cell will be red.
sheet.getCell(0, 1).backColor("accent 6"); // The background color of the cell will be green.
Name | Type |
---|---|
value? |
ColorScheme |
any
If no value is set, returns the base colors of the theme; otherwise, returns the theme.
▸ headerFont(value?
): any
Gets or sets the heading font of the theme.
example
var custom = new GC.Spread.Sheets.Theme("Custom");
custom.headerFont('cursive');
sheet.currentTheme(custom);
sheet.getCell(0, 0).themeFont('Headings');
sheet.setValue(0, 0, 'hello world!'); // The font of the cell will be 'cursive'.
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the heading font; otherwise, returns the theme.
▸ name(value?
): any
Gets or sets the name of the theme.
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the theme name; otherwise, returns the theme.