Skip to content

Instantly share code, notes, and snippets.

@chrisdavidmills
Created September 2, 2013 15:53
Show Gist options
  • Save chrisdavidmills/6414378 to your computer and use it in GitHub Desktop.
Save chrisdavidmills/6414378 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="myCanvas" width="500" height="500">
<p>Your browser doesn't support Canvas.</p>
</canvas>
</body>
</html>
var myCanvas = document.getElementById('myCanvas');
var myContext = myCanvas.getContext('2d');
for(i=0;i<=25;i++) {
myContext.fillStyle = 'rgba(0,0,' + (Math.floor(Math.random()*200)) + ',0.5)';
myContext.fillRect((i*20),i,25+(i*10),25+(i*10));
myContext.rotate(0.025);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment