Skip to content

Commit ad31c93

Browse files
authored
Update define-dynamic-block.js
1 parent 77c57a6 commit ad31c93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/define-dynamic-block.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const defineDynamicBlock = (ScratchBlocks, categoryInfo, staticBlockInfo, extend
2222
category: categoryInfo.name,
2323
colour: categoryInfo.color1,
2424
colourSecondary: categoryInfo.color2,
25-
colourTertiary: categoryInfo.color3
25+
colourTertiary: categoryInfo.color3,
26+
textColour: categoryInfo.blockText,
2627
};
2728
// There is a scratch-blocks / Blockly extension called "scratch_extension" which adjusts the styling of
2829
// blocks to allow for an icon, a feature of Scratch extension blocks. However, Scratch "core" extension
@@ -83,6 +84,9 @@ const defineDynamicBlock = (ScratchBlocks, categoryInfo, staticBlockInfo, extend
8384
// `setColour` handles undefined parameters by adjusting defined colors
8485
this.setColour(blockInfo.color1, blockInfo.color2, blockInfo.color3);
8586
}
87+
if (blockInfo.blockText) {
88+
this.setTextColour(blockInfo.blockText);
89+
}
8690

8791
// Layout block arguments
8892
// TODO handle E/C Blocks

0 commit comments

Comments
 (0)