[]
        
(Showing Draft Content)

GC.Spread.Sheets.Theme

Class: Theme

Spread.Sheets.Theme

Table of contents

Constructors

Methods

Constructors

constructor

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);
})

Parameters

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.

Methods

bodyFont

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

Parameters

Name Type
value? string

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
value? ColorScheme

Returns

any

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


headerFont

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

Parameters

Name Type
value? string

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
value? string

Returns

any

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