From 8616390fabcfaa686a746a1359d7083d6261b166 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 3 Nov 2017 21:24:47 -0400 Subject: [PATCH] Add back pen transparency from color number --- src/blocks/scratch3_pen.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/blocks/scratch3_pen.js b/src/blocks/scratch3_pen.js index 7de5e51a6..2a0bd4908 100644 --- a/src/blocks/scratch3_pen.js +++ b/src/blocks/scratch3_pen.js @@ -451,7 +451,11 @@ class Scratch3PenBlocks { penState.color = (hsv.h / 360) * 100; penState.saturation = hsv.s * 100; penState.brightness = hsv.v * 100; - penState.transparency = 0; + if (rgb.hasOwnProperty('a')) { + penState.transparency = 100 * (1 - rgb.a / 255.0); + } else { + penState.transparency = 0; + } // Set the legacy "shade" value the same way scratch 2 did. penState._shade = penState.brightness / 2;