canvas设置渐变 方法 createLinearGradient(x1, y1, x2, y2) 线性渐变 createRadialGradient(x1, y1, r1, x2, y2, r2) 辐射渐变 线性渐变 const canvas = document.getElementById('canvas'); const ctx = canvas.getContext('2d'); var lingrad = ctx.createLinearGradient(0, 0, 0, 150)