code-dot-org/blockly-core — pull request #78 by Bjvanminnen (2014-05-08 17:34:00+00:00)
Title: better fill behavior

A blockly block consists of a group of a few paths.
(1) blocklyPathDark (a darker version of the set HSV to provide the bevel on the right and bottom)
(2) blocklyPath (the main portion, color of setHSV)
(3) blocklyPathLight (a lighter version to provide the bevel on the top and left).

Previously, when setting a pattern I would change blocklyPath to have a fill of the image instead of a fill using the color from setHSV. However, when our image has transparency, this means the transparent parts will be on top of the blocklyPathDark color instead of the color we used in setHSV.

![image](https://cloud.githubusercontent.com/assets/1767466/2919035/af4bf3ec-d6d6-11e3-892a-0eac8adb9435.png)

The fix is to duplicate blocklyPath. One of these will have a solid color based fill, and one will have our image/pattern based fill.

![image](https://cloud.githubusercontent.com/assets/1767466/2919042/d0ae14ca-d6d6-11e3-8d65-d49417d08eed.png)

![image](https://cloud.githubusercontent.com/assets/1767466/2919049/e2cf2a22-d6d6-11e3-80df-309398805d3e.png)