Canvas shadowBlur Attribute

Definition and Usage

shadowBlur Sets or returns the blur level of the shadow.

Example

Draw a blue rectangle with a black shadow, with a blur level of 20:

Your browser does not support the canvas tag.

JavaScript:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.shadowBlur=20;
ctx.shadowColor="black";
ctx.fillStyle="blue";
ctx.fillRect(20,20,100,80);

Try it yourself

Syntax

context.shadowBlur=number;

Attribute Value

Value Description
number The blur level of the shadow.

Technical Details

Default Value: #000000

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
4.0 9.0 3.6 4.0 10.1

Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.