Skip to content

Instantly share code, notes, and snippets.

@bashbaugh
Last active February 24, 2019 19:51
Show Gist options
  • Select an option

  • Save bashbaugh/efeb8dca816d47c0bbe8ebb3fa531455 to your computer and use it in GitHub Desktop.

Select an option

Save bashbaugh/efeb8dca816d47c0bbe8ebb3fa531455 to your computer and use it in GitHub Desktop.
function draw_background()
{
// First we erase everything on the canvas:
canvas.clearRect(0, 0, canvas_element.width, canvas_element.height);
// And then we change the color of our "paintbrush":
canvas.fillStyle = "#1EBA00";
// And then we draw a colored rectangle that covers the entire canvas:
canvas.fillRect(0, 0, canvas_element.width, canvas_element.height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment