1 渐变

线性渐变:

ctx.createLinearGradient(20,20,100,100);

参数1,参数2,参数3,参数4 的连线决定了渐变的方向和区间

添加渐变色:

ctx.addColorStop(0,'red')

参数1 : 只能是0--1的小数 渐变的起始位置 参数2 :颜色

径向渐变:

ctx.createRadialGradient(200,200,50,130,200,100);

参数1,参数2,参数3,第一个小圆的圆心和半径 参数4,参数5,参数6,第二个大圆的圆心和半径

results matching ""

    No results matching ""