Most appropriate sub-area of p5.js?
p5.js version
2.3.3
Web browser and version
Safari 26.5.2, Arc 1.163.1
Operating system
MacOSX 15.7.7
Steps to reproduce this
Steps:
- Draw a TRIANGLE_FAN in PSD mode, changing the fill color on every vertex
- Observe that the resulting shape is a single color
Snippet:
const NUM_SLICES = 28;
const RADIUS = 280
function setup() {
createCanvas(600, 600);
background(255);
noLoop();
colorMode(HSB, TWO_PI, 100, 100);
}
function draw() {
const step = TWO_PI / NUM_SLICES;
const cx = width/2;
const cy = height / 2;
noStroke();
beginShape(TRIANGLE_FAN);
vertex(cx , cy );
for (let theta = 0; theta <= TWO_PI; theta+=step){
fill(theta, 100, 100);
vertex(cx + RADIUS * cos(theta), cy + RADIUS * sin(theta));
}
endShape();
}
This is a very simple color wheel that used to work in v 1.x. Now I get a circle that is entirely red. A little poking suggests that the library is combining all of the vertices into a single shape instead of detecting the color changes and creating separate shapes.
Most appropriate sub-area of p5.js?
p5.js version
2.3.3
Web browser and version
Safari 26.5.2, Arc 1.163.1
Operating system
MacOSX 15.7.7
Steps to reproduce this
Steps:
Snippet:
This is a very simple color wheel that used to work in v 1.x. Now I get a circle that is entirely red. A little poking suggests that the library is combining all of the vertices into a single shape instead of detecting the color changes and creating separate shapes.