beginShape() with fill gradient

Hello, I cannot seem to replicate the following in p5js to make a gradient. Can anybody help me with why is this?

void setup() { size(128, 128, OPENGL); background(128); noStroke(); beginShape(); fill(0); vertex(30, 20); vertex(85, 20); fill(0,255,0); vertex(85, 75); vertex(30, 75); endShape(); }

Answers

Sign In or Register to comment.