Constructor

Theme

new Theme(blockStyles, categoryStyles)

Class for a theme.

Parameter

blockStyles

Object with Blockly.BlockStyle properties

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

categoryStyles

Object with Blockly.CategoryStyle properties

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

Methods

getAllBlockStyles

getAllBlockStyles() returns Array of String

Gets a list of all the block style names.

Returns

Array of String List of blockstyle names.

getBlockStyle

getBlockStyle(blockStyleName) returns Blockly.BlockStyle

Gets the BlockStyle for the given block style name.

Parameter

blockStyleName

string

The name of the block style.

Returns

Blockly.BlockStyle The style with the block style name.

getCategoryStyle

getCategoryStyle(categoryStyleName) returns Blockly.CategoryStyle

Gets the CategoryStyle for the given category style name.

Parameter

categoryStyleName

string

The name of the block style.

Returns

Blockly.CategoryStyle The style with the block style name.

setAllBlockStyles

setAllBlockStyles(blockStyles)

Overrides or adds all values from blockStyles to blockStyles_

Parameter

blockStyles

Object with Blockly.BlockStyle properties

List 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.BlockStyle

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

The category style