May 19, 2021 WeChat Mini Program Development Document
Drawing interfaces and methods
Set the fill color.
Tip
: If
fillStyle
the default color is
black
Parameters | Type | Defined | |
---|---|---|---|
color | Color | Gradient Object | Fill color |
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()