function canvasReady() {
draw(document.getElementById('canvas').getContext('2d'));
}
function draw(ctx) {
// Create gradients
var lingrad = ctx.createLinearGradient(0,0,0,150);
lingrad.addColorStop(0, '#00ABEB');
lingrad.addColorStop(0.5, '#fff');
lingrad.addColorStop(0.5, '#66CC00');
lingrad.addColorStop(1, '#fff');
ctx.textBaseline = "top";
ctx.font = "36pt Arial";
ctx.fillStyle = lingrad;
ctx.strokeStyle = lingrad;
var text = setShadow(ctx, "black", 10, 10, 4);
ctx.fillText("fillText: " + text, 20, 20);
ctx.strokeText("strokeText: " + text, 20, 80);
}
function setShadow(ctx, color, ox, oy, blur) {
ctx.shadowColor = color;
ctx.shadowOffsetX = ox;
ctx.shadowOffsetY = oy;
ctx.shadowBlur = blur;
return [color, ox, oy, blur].join(", ");
}