Using colorMode in instance says HSB is not defined

I'm having trouble changing the colorMode to HSB in an instance. Writing colorMode(HSB) in a global scenario works just fine though. Any ideas?

var myp5 = new p5(function(p) {

var x = 100; var y = 100;

p.setup = function() { p.createCanvas(700, 410); p.colorMode(HSB); };

p.draw = function() { p.background(0); p.fill(20); p.rect(x,y,50,50); }; },'p5sketchEX');

Tagged:

Answers

Sign In or Register to comment.