blockly > blockRendering > ConstantProvider > getBlockStyleForColour

blockRendering.ConstantProvider.getBlockStyleForColour() method

Get or create a block style based on a single colour value. Generate a name for the style based on the colour.

Signature:

getBlockStyleForColour(colour: string): {
        style: BlockStyle;
        name: string;
    };

Parameters

Parameter Type Description
colour string #RRGGBB colour string.

Returns:

{ style: BlockStyle; name: string; }

An object containing the style and an autogenerated name for that style.