Why default Black color in chrome

New to p5.js how come my default color is black when i run it in chrome? using brackets

function setup() {

function draw() {
rect(180, 60, 220, 40);

Use fill command eg


or fill(255,0,0); before rect() command


I tried this on a W10 Pro PC with the p5.js editor and the p5.js mode with Processing IDE and used Google Chrome and got the same results:


I do not know why the default is black in your case.

What version are you using?

For example:

I assume you have the latest Google Chrome.

Running on PC, Chromebook, tablet or phone?


I’m using Brackets1.14.2 on wind 10

But when i remove createCanvas it became white


I do not use Brackets and can’t comment further on this.

learn | p5.js < The Using a local server section comments on Brackets.