欢迎加QQ交流:
2
0
2
3

ctx.createCircularGradient is not a function

   正确
 
   const grd = ctx.createCircularGradient(75, 50, 50)
    grd.addColorStop(0, 'red')
    grd.addColorStop(1, 'white')
    ctx.setFillStyle(grd)
    ctx.fillRect(10, 10, 150, 80)
 
错误
 
    const grd = ctx.createRadialGradient(100, 100, 100, 100, 100, 0);
    grd.addColorStop(0,'white');
    grd.addColorStop(1,'green');
    ctx.setFillStyle(grd);
    ctx.fillRect(20, 20, 250, 180);
posted @ 2022-01-24 14:54  常安·  阅读(153)  评论(0编辑  收藏  举报