WeChat applet API drawing·set fill style setFillStyle
setFillStyle
Definition
Set the fill color.
Tip: If fillStyle
is not set, the default color is black
.
Parameters
Parameters | Type | Definition | |
---|---|---|---|
color | Color \ | Gradient Object | fill color |
Example
const ctx = wx.createCanvasContext('myCanvas') ctx.setFillStyle('red') ctx.fillRect(10, 10, 150, 75) ctx.draw()