function updateCanvas(square) {
    ctx.clearRect(square.yPos, square.xPos, square.xSize, square.ySize);
    ctx.fillStyle = square.color;
    ctx.fillRect(square.yPos, square.xPos, square.xSize, square.ySize)
}
// redraws the canvas with the updated values.
redraws the canvas with the updated values.
redraws the canvas with the updated values .
function updateCanvas(square) {
    ctx.clearRect(square.yPos, square.xPos, square.xSize, square.ySize);
    ctx.fillStyle = square.color;
    ctx.fillRect(square.yPos, square.xPos, square.xSize, square.ySize)
}
function updateCanvas ( square ) { ctx . clearRect ( square . yPos , square . xPos , square . xSize , square . ySize ) ; ctx . fillStyle = square . color ; ctx . fillRect ( square . yPos , square . xPos , square . xSize , square . ySize ) }
redraws the canvas with the updated values.
redraws the canvas with the updated values .