[]
• new Theme(name
, colorScheme
, headerFont
, bodyFont
)
配色方案
代码示例
//本示例创建了一个新的SpreadTheme对象
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 |
string |
主题的名称 |
colorScheme |
ColorScheme |
主题颜色的基本颜色 |
headerFont |
string |
标题字体的名称 |
bodyFont |
string |
正文字体的名称 |
▸ bodyFont(value?
): any
获取或设置主题的正文字体
代码示例
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'.
属性名 | 类型 |
---|---|
value? |
string |
any
如果没有设置值,返回正文字体;否则,返回主题
▸ colors(value?
): any
获取或设置主题的基本颜色
代码示例
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.
属性名 | 类型 |
---|---|
value? |
ColorScheme |
any
如果没有设置值,返回主题的基本颜色;否则,返回主题
▸ headerFont(value?
): any
获取或设置主题的标题字体
代码示例
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'.
属性名 | 类型 |
---|---|
value? |
string |
any
如果没有设置值,返回标题字体;否则,返回主题
▸ name(value?
): any
获取或设置主题的名称
属性名 | 类型 |
---|---|
value? |
string |
any
如果没有设置值,返回主题名称;否则,返回主题