Canvas shadow & globalAlpha

by MICHI CHEN

HTML

<canvas id="myCanvas" width="340" height="200"></canvas>

JavaScript

$(function(){
	var ctx=$('#myCanvas')[0].getContext('2d');
  ctx.rect(10,10,100,100);
  ctx.fillStyle='#E9EA6B';
  ctx.shadowColor="#B7A766";
  ctx.shadowBlur=10;
  ctx.shadowOffsetX=5;
  ctx.shadowOffsetY=5;
  ctx.fill();
  
  ctx.beginPath();
  ctx.arc(200,60,50,0,2*Math.PI);
  ctx.fillStyle='#50510D';
  ctx.fill();
  
  ctx.beginPath();
  ctx.globalAlpha=0.5;
  ctx.arc(250,60,50,0,2*Math.PI);
  ctx.fillStyle='#758CC0';
  ctx.fill();
});