Skip to content

Instantly share code, notes, and snippets.

@chikoski
Created November 6, 2013 11:48
Show Gist options
  • Select an option

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

Select an option

Save chikoski/7334838 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.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);
}
};
draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment