Constructor

Theme

new Theme(blockStyles, categoryStyles)

Class for a theme.

Parameter

blockStyles

Object with Blockly.Theme.Style properties

A map from style names (strings) to objects with style attributes relating to blocks.

Value must not be null.

categoryStyles

Object with Blockly.Theme.Style properties

A map from style names (strings) to objects with style attributes relating to categories.

Value must not be null.

Methods

getAllBlockStyles

getAllBlockStyles() returns Object with Blockly.Theme.Style properties

Gets a map of all the block style names.

Returns

non-null Object with Blockly.Theme.Style properties Map of block styles.

getBlockStyle

getBlockStyle(blockStyleName) returns (Blockly.Theme.Style or undefined)

Gets the BlockStyle for the given block style name.

Parameter

blockStyleName

string

The name of the block style.

Returns

(Blockly.Theme.Style or undefined) The named block style.

getCategoryStyle

getCategoryStyle(categoryStyleName) returns (Blockly.Theme.Style or undefined)

Gets the CategoryStyle for the given category style name.

Parameter

categoryStyleName

string

The name of the category style.

Returns

(Blockly.Theme.Style or undefined) The named category style.

setAllBlockStyles

setAllBlockStyles(blockStyles)

Overrides or adds all values from blockStyles to blockStyles_

Parameter

blockStyles

Object with Blockly.Theme.Style properties

Map of block styles.

setBlockStyle

setBlockStyle(blockStyleName, blockStyle)

Overrides or adds a style to the blockStyles map.

Parameter

blockStyleName

string

The name of the block style.

blockStyle

Blockly.Theme.Style

The block style.

setCategoryStyle

setCategoryStyle(categoryStyleName, categoryStyle)

Overrides or adds a style to the categoryStyles map.

Parameter

categoryStyleName

string

The name of the category style.

categoryStyle

Blockly.Theme.Style

The category style.

Abstract type

Style

static

non-null Object with string properties

A block style or a category style.