Advertisement
Home Open Editor ❯

HTML canvas shadowBlur Property

Example

// Accessing the element
let c = document.getElementById("myCanvas");

// Styling canvas
let ctx = c.getContext("2d");
ctx.shadowBlur = 10;
ctx.shadowColor = "black";
ctx.fillStyle = "red";
ctx.fillRect(25, 25, 100, 100);

Try this code ❯

Meaning

The shadowBlur canvas property sets or returns the blur level for shadows.


Standard Syntax

Default value:

0

JavaScript syntax:

context.shadowBlur=number;


Advertisement

Property Values

Value Description
number Specifies the blur level for the shadow.
Home Open Editor ❯
Advertisement