Created
March 13, 2015 00:11
-
-
Save Spaxe/484081c34be058376ad2 to your computer and use it in GitHub Desktop.
p5js with browserfy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thanks to @brysonian | |
// https://github.com/processing/p5.js/issues/522#issuecomment-78510817 | |
var p5 = require("p5"); | |
var myp5 = new p5(function( sketch ) { | |
sketch.setup = function() { | |
var cnv = sketch.createCanvas(500, 500); | |
sketch.colorMode(sketch.HSB, 360, 100, 100); | |
sketch.noStroke(); | |
}; | |
sketch.draw = function() { | |
var h = sketch.frameCount % 360; | |
sketch.fill(h, 100, 100); | |
sketch.rect(0, 0, sketch.width, sketch.height); | |
}; | |
}, 'sketchdiv'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment