Answers for "how to change canvas color in javascript"

1

how to change canvas color in javascript

let canvas = document.getElementById("canvas");
let ctx = canvas.getContext("2d");

ctx.fillStyle = "#ff0000";
ctx.fillRect(20, 20, 150, 100);
Posted by: Guest on March-05-2021

Code answers related to "how to change canvas color in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language