Skip to content

Instantly share code, notes, and snippets.

@benjiwheeler
Created June 10, 2015 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjiwheeler/45d5162df84bf7a517b7 to your computer and use it in GitHub Desktop.
Save benjiwheeler/45d5162df84bf7a517b7 to your computer and use it in GitHub Desktop.
Processing simple rectangle in javascript
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.9/processing.js"></script>
</head>
<body>
<div>
<canvas id="canvas" width="600" height="600" />
</div>
The content of the body element is displayed in your browser.
<script type="text/processing" data-processing-target="canvas">
void setup() {
var width = 600;
var height = 600;
size(width,height);
noStroke();
noFill();
drawComposition2();
};
var drawComposition2 = function(){
fill(6,2,3)
rect(100,100,150,150)
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment