Skip to content

Commit

Permalink
Allow block colors with transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jan 9, 2024
1 parent bbdff1e commit 958df3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ Blockly.Block.prototype.makeColour_ = function(colour) {
var hue = Number(colour);
if (!isNaN(hue)) {
return Blockly.hueToRgb(hue);
} else if (goog.isString(colour) && colour.match(/^#[0-9a-fA-F]{6}$/)) {
} else if (goog.isString(colour) && colour.match(/^#[0-9a-fA-F]{6,8}$/)) {
return colour;
} else {
throw 'Invalid colour: ' + colour;
Expand Down

0 comments on commit 958df3f

Please sign in to comment.