HTML canvas shadowBlur Property

❮ HTML canvas Reference

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);

Meaning

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


Standard Syntax

Default value:

0

JavaScript syntax:

context.shadowBlur=number;



Browser Support




Status







Property Values

Value Description
number Specifies the blur level for the shadow.
❮ HTML canvas Reference