title: Dynamic Fill color in Canvas
body: <p>I am working on Canvas object  fill color cylinder dynamically with animation. I have created Cylinder and animation working fine. Right now it was filling color automatically. But what I want is When I enter percentage value in text box cylinder has fill the color.</p>
  
  <pre><code>function drawContainer(cx, cy, width, height, degreeAngle) 
  {
      ctx.fillStyle = '#E2E2E2';
      ctx.beginPath();        
      ctx.fill();
      defineFillOutline(cx, cy, width, height, degreeAngle);
      ctx.save();
      ctx.translate(cx, cy);
      ctx.rotate(degreeAngle * PI / 180);
      ctx.moveTo(-w2, -h2 + h8);
      ctx.bezierCurveTo(-w2, -h4, w2, -h4, w2, -h2 + h8);
      ctx.strokeStyle = "royalblue";
      ctx.lineWidth = 2;
      ctx.stroke();
      ctx.restore();
  }
  </code></pre>
  
  <p>Here is the entire code in JSFiddle</p>
  
  <p><a href="http://jsfiddle.net/8b9G8/" rel="nofollow">http://jsfiddle.net/8b9G8/</a></p>
  
  <p>Thanks in advance
  Maha</p>