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



post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts