function floodFills(px, py) {
var firstClick=new Array()
wx.canvasGetImageData({
canvasId: 'borad',
x: px,
y: py,
width: 1,
height: 1,
success(res) {
firstClick = Array.from(res.data)
if(firstClick[0] == 18 && firstClick[1] == 52 && firstClick[2]==86){
dye(px, py)
console.log(1)
floodFills(px + 1, py)
floodFills(px - 1, py)
floodFills(px, py + 1)
floodFills(px, py - 1)
}
}
})
}
我也遇到相同的问题
一次就结束了?那你想执行几次啊。。数据都在 res.data里啊