HTML canvas shadowOffSetY Property
Example
// Accessing the element
let c = document.getElementById("myCanvas");
// Styling canvas
let ctx = c.getContext("2d");
ctx.shadowBlur = 10;
ctx.shadowOffsetY = 10;
ctx.shadowColor = "black";
ctx.fillStyle = "red";
ctx.fillRect(25, 25, 100, 100);
Meaning
The shadowOffSetY canvas property sets or returns the vertical distance of the shadow from the shape.
Standard Syntax
Default value:
0
JavaScript syntax:
context.shadowOffSetY=number;
Advertisement
Property Values
| Value | Description |
|---|---|
| number | Specifies a positive or negative number that defines the vertical distance of the shadow from the shape. |