[]
        
(Showing Draft Content)

GC.Spread.Sheets.Theme

Class: Theme

Spread.Sheets.Theme

Table of contents

Constructors

Methods

Constructors

constructor

• new Theme(name, colorScheme, headingFont, 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);
})

Parameters

Name Type Description
name string The name of the theme.
colorScheme ColorScheme The base colors of the theme color.
headingFont string The name of the heading font.
bodyFont string The name of the body font.

Methods

bodyFont

▸ bodyFont(value?): any

Gets or sets the body font of the theme depending on the culture.

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'.

Parameters

Name Type Description
value? string The body font.

Returns

any

If no value is set, returns the body font; otherwise, returns the theme.


colors

▸ 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.

Parameters

Name Type Description
value? ColorScheme The base colors of the theme.

Returns

any

If no value is set, returns the base colors of the theme; otherwise, returns the theme.


font

▸ font(value?): any

Gets or sets the font of the theme.

example

var custom = new GC.Spread.Sheets.Theme("Custom");
custom.font().bodyFont("cursive");
sheet.currentTheme(custom);

Parameters

Name Type Description
value? ThemeFont The font of the theme.

Returns

any

If no value is set, returns the font of the theme; otherwise, returns the theme.


headerFont

▸ headerFont(value?): any

Gets or sets the heading font of the theme.

deprecated since version 18.1.0, please use 'headingFont' instead.

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'.

Parameters

Name Type Description
value? string The heading font.

Returns

any

If no value is set, returns the heading font; otherwise, returns the theme.


headingFont

▸ headingFont(value?): any

Gets or sets the heading font of the theme depending on the culture.

example

var custom = new GC.Spread.Sheets.Theme("Custom");
custom.headingFont('cursive');
sheet.currentTheme(custom);
sheet.getCell(0, 0).themeFont('Headings');
sheet.setValue(0, 0, 'hello world!'); // The font of the cell will be 'cursive'.

Parameters

Name Type Description
value? string The heading font.

Returns

any

If no value is set, returns the heading font; otherwise, returns the theme.


name

▸ name(value?): any

Gets or sets the name of the theme.

Parameters

Name Type Description
value? string The theme name.

Returns

any

If no value is set, returns the theme name; otherwise, returns the theme.