Dokumentation zur WeChat-Applet-Entwicklung
/ 微信小程序API 繪圖·設(shè)置填充樣式setFillStyle
微信小程序API 繪圖·設(shè)置填充樣式setFillStyle
setFillStyle
定義
設(shè)置填充色。
Tip: 如果沒有設(shè)置 fillStyle
,默認(rèn)顏色為 black
。
參數(shù)
參數(shù) | 類型 | 定義 | |
---|---|---|---|
color | Color \ | Gradient Object | 填充色 |
例子
const ctx = wx.createCanvasContext('myCanvas') ctx.setFillStyle('red') ctx.fillRect(10, 10, 150, 75) ctx.draw()