mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Add back pen transparency from color number
This commit is contained in:
parent
ef961c5a4b
commit
8616390fab
1 changed files with 5 additions and 1 deletions
|
@ -451,7 +451,11 @@ class Scratch3PenBlocks {
|
||||||
penState.color = (hsv.h / 360) * 100;
|
penState.color = (hsv.h / 360) * 100;
|
||||||
penState.saturation = hsv.s * 100;
|
penState.saturation = hsv.s * 100;
|
||||||
penState.brightness = hsv.v * 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.
|
// Set the legacy "shade" value the same way scratch 2 did.
|
||||||
penState._shade = penState.brightness / 2;
|
penState._shade = penState.brightness / 2;
|
||||||
|
|
Loading…
Reference in a new issue