Use setGlobalAlpha to set global brush transparency in WeChat applet API drawing
setGlobalAlpha
Definition
Set global brush transparency.
Parameters
Example
const ctx = wx.createCanvasContext('myCanvas') ctx.setFillStyle('red') ctx.fillRect(10, 10, 150, 100) ctx.setGlobalAlpha(0.2) ctx.setFillStyle('blue') ctx.fillRect(50, 50, 150, 100) ctx.setFillStyle('yellow') ctx.fillRect(100, 100, 150, 100) ctx.draw()