是.例:
// linear gradient from start to end of line
var grad= ctx.createLinearGradient(50,50,150,150);
grad.addColorStop(0,"red");
grad.addColorStop(1,"green");
ctx.strokeStyle = grad;
ctx.beginPath();
ctx.moveto(50,50);
ctx.lineto(150,150);
ctx.stroke();
在这里看到它:
http://jsfiddle.net/9bMPD/