From 958df3fe5b22ecad96b2363ebbcb8f643f362f0e Mon Sep 17 00:00:00 2001 From: Muffin Date: Tue, 9 Jan 2024 15:56:40 -0600 Subject: [PATCH] Allow block colors with transparency --- core/block.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/block.js b/core/block.js index 176cbcc586..ae49a86015 100644 --- a/core/block.js +++ b/core/block.js @@ -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;