Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
const ctx = canvas.getContext("2d"); ctx.shadowColor = "rgba(0, 0, 0, 0.4)"; ctx.shadowBlur = 15; ctx.shadowOffsetX = 5; ctx.shadowOffsetY = 5; ctx.fillStyle = "#007bff"; ctx.fillRect(50, 50, 200, 100); // Reset shadow for next drawing ctx.shadowColor = "transparent"; ctx.shadowBlur = 0;
Result
Open