Blog

Shadow Color Attribute of Canvas in HTML5

Posted by Mahak Gupta Blogs | HTML 5 Mar 11, 2012
This attribute specifies the color of the shadow.
This attribute specifies the color of the shadow. We can define it by the shadowOffsetX, shadowOffsetY, and the shadowBlur property. Here we discuss the shadowBlur Property.

<canvas id="myfirstCanvas" width="250" height="150" style="border:1px solid;#d3d3d3;">
 </canvas>

<script type="text/javascript">

var mycanvas=document.getElementById("myfirstCanvas");
var x=mycanvas.getContext("2d");
x.rect(20,30,40,50);
x.fillStyle="pink";
x.shadowColor="black";
x.shadowBlur=20;
x.fill();

</script>

</body>
</html>

1.png



COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.