Add special case for colour picker stroke (#548)

This commit is contained in:
Tim Mickel 2016-07-26 14:30:09 -04:00 committed by GitHub
parent 32ec18a6a7
commit 6006f24801
2 changed files with 7 additions and 0 deletions

View file

@ -453,6 +453,12 @@ Blockly.BlockSvg.prototype.updateColour = function() {
if (this.isShadow() && this.parentBlock_) {
// Pull shadow block stroke colour from parent block's tertiary if possible.
strokeColour = this.parentBlock_.getColourTertiary();
// Special case: if we contain a colour field, set to a special stroke colour.
if (this.inputList[0] &&
this.inputList[0].fieldRow[0] &&
this.inputList[0].fieldRow[0] instanceof Blockly.FieldColour) {
strokeColour = Blockly.Colours.colourPickerStroke;
}
}
// Render block stroke

View file

@ -90,6 +90,7 @@ Blockly.Colours = {
"stackGlowOpacity": 1,
"replacementGlow": "#FFFFFF",
"replacementGlowOpacity": 1,
"colourPickerStroke": "#FFFFFF",
// CSS colours: support RGBA
"fieldShadow": "rgba(0,0,0,0.1)",
"dropDownShadow": "rgba(0, 0, 0, .3)",