Thank you for your response.
I still don't understand why it won't work though. I changed the code to render the "fading circle" in PGraphics:
- pg.beginDraw();
- pg.noStroke();
- pg.background(0);
- for(int x=0;x<width;x++){
- if(x%4==0){
- for(int y=0;y<height;y++){
- if(y%4==0){
- //pixels[y*width+x] = colorPixel(x,y);
- float[] c = colorPixel(x,y);
- pg.fill(c[0],c[1],c[2],c[3]);
- pg.rect(x,y,8,8);
- }
- }
- }
- }
- pg.endDraw();
- image(pg,0,0);