scratchfoundation / scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
http://scratchfoundation.github.io/scratch-vm/
BSD 3-Clause "New" or "Revised" License
1.22k stars 1.52k forks source link

pen layer doesn't blend transparent colors with the background properly #1926

Open BryceLTaylor opened 5 years ago

BryceLTaylor commented 5 years ago

Expected Behavior

Adding a partly transparent black pen mark to the pen layer should always darken the backdrop. It should interact with colors behind it in the same way that it interacts with other marks on the pen player.

Actual Behavior

If you make a black, but mostly transparent mark on the pen layer over a red circle it will lighten the color. The same mark over the same color red in the pen layer will make it slightly darker.

screen shot 2019-01-15 at 4 18 40 pm (the circle on the left is part of the backdrop, the one on the right is in the pen layer. They have the exact same shade of red. A circle has been printed in the middle with pen down, pen up, that has the color 0, 0, 0 and transparency of 80)

I used this project to test it: https://scratch.mit.edu/projects/279557616/editor

It is a modification of a project from a user: https://scratch.mit.edu/projects/277120576/editor/

Steps to Reproduce

Create a new project Edit the backdrop in the paint editor so it has a circle on the side of the screen that has the color 0, 100, 100. Delete the default cat sprite Paint a new sprite but don't paint anything in the costume Move the empty sprite to x: 100 y: 0 Set the pen size to 300 Run the pen down block run the pen up block Move the empty sprite to x:0 y:0 set the pen color to 0, 0, 0 set the transparency to 80 run the pen down block run the pen up block Note: the two red circles respond differently to the mostly transparent black that has been added to the pen layer

Operating System and Browser

Mac Chrome

BryceLTaylor commented 5 years ago

A project came in from the community showing a similar issue: https://scratch.mit.edu/projects/276987518/