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.

```
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();
}

```

Here is the entire code in JSFiddle

<http://jsfiddle.net/8b9G8/>

Thanks in advance
Maha