Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save chikoski/7335683 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 canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var draw = function(){
if(ctx !== null){
ctx.strokeStyle = "black";
ctx.fillStyle = "black";
ctx.beginPath();
ctx.arc(240, 240, 20, 0, 2 * Math.PI);
ctx.closePath();
ctx.fill();
ctx.beginPath();
ctx.arc(240, 240, 40, 0.3 * Math.PI, 1.8 * Math.PI, false);
ctx.stroke();
ctx.beginPath();
ctx.arc(240, 240, 80, 1.5 * Math.PI, Math.PI, false);
ctx.stroke();
ctx.beginPath();
ctx.arc(240, 240, 140, 0, 2 * Math.PI);
ctx.stroke();
}
};
draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment