showing results for - "how to change canvas color in javascript"
Giorgio
30 May 2018
1let canvas = document.getElementById("canvas");
2let ctx = canvas.getContext("2d");
3
4ctx.fillStyle = "#ff0000";
5ctx.fillRect(20, 20, 150, 100);
6 
Valentina
29 Nov 2019
1
2let ctx = canvas.getContext("2d");
3
4ctx.fillStyle = "#ff0000";
5ctx.fillRect(20, 20, 150, 100);
6