mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Adds ability to provide a hue value for primary colour
This commit is contained in:
@@ -938,7 +938,7 @@ Blockly.Block.prototype.setStyle = function(blockStyleName) {
|
||||
|
||||
if (blockStyle) {
|
||||
this.style_ = blockStyle;
|
||||
this.colour_ = blockStyle.primaryColour;
|
||||
this.setColour(blockStyle.primaryColour);
|
||||
this.secondaryColour_ = blockStyle.secondaryColour;
|
||||
this.tertiaryColour_ = blockStyle.tertiaryColour;
|
||||
}
|
||||
|
||||
@@ -120,17 +120,15 @@ function test_setStyleForBlockly() {
|
||||
var blockStyles = createBlockStyles();
|
||||
var workspace = new Blockly.WorkspaceSvg({});
|
||||
var blockA = workspace.newBlock('stack_block');
|
||||
var blocks;
|
||||
var blocks = [blockA];
|
||||
|
||||
blockA.setStyle = function(){this.styleName_ = 'styleTwo'};
|
||||
var something = 1;
|
||||
var callCount = 1;
|
||||
workspace.refreshToolboxSelection = function(){
|
||||
return ++something;
|
||||
return ++callCount;
|
||||
};
|
||||
blockA.styleName_ = 'styleOne';
|
||||
|
||||
blocks = [blockA];
|
||||
|
||||
setUpMockMethod(mockControl_, Blockly, 'getMainWorkspace', null, [workspace]);
|
||||
|
||||
Blockly.setStyle(blockStyles);
|
||||
|
||||
Reference in New Issue
Block a user