xxxxxxxxxx
24
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(220);
strokeWeight(3);
beginShape();
//red (also works with fill)
stroke(255, 0, 0);
vertex(0, -100);
//green (also works with fill)
stroke(0, 255, 0);
vertex(-100, 100);
//blue (also works with fill)
stroke(0, 0, 255);
vertex(100, 100);
endShape(CLOSE);
}