Skip to content

Instantly share code, notes, and snippets.

@chikoski
Created November 6, 2013 12:05
Show Gist options
  • Select an option

  • Save chikoski/7335043 to your computer and use it in GitHub Desktop.

Select an option

Save chikoski/7335043 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<canvas id="canvas" width="480" height="480"></canvas>
</body>
</html>
var draw = function(){
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgb(204, 96, 96)";
ctx.fillRect(180, 180, 100, 100);
ctx.fillStyle = "rgba(96, 96, 204, 0.8)";
ctx.fillRect(210, 210, 100, 100);
ctx.strokeStyle = "rgb(32, 32, 32)";
ctx.strokeRect(220, 220, 50, 50);
ctx.clearRect(190, 190, 30, 30);
ctx.clearRect(270, 270, 30, 30);
};
draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment