Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Cannot figure out why alpha is acting strange here!

$
0
0
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:

  1.  pg.beginDraw();
  2.   pg.noStroke();
  3.   pg.background(0);
  4.   for(int x=0;x<width;x++){
  5.     if(x%4==0){
  6.       for(int y=0;y<height;y++){
  7.         if(y%4==0){
  8.           //pixels[y*width+x] = colorPixel(x,y);
  9.           float[] c = colorPixel(x,y);
  10.           pg.fill(c[0],c[1],c[2],c[3]);
  11.           pg.rect(x,y,8,8);
  12.         }
  13.       }
  14.     }
  15.   }
  16.   pg.endDraw();
  17.   image(pg,0,0);
It still renders exactly the same with black rather than alpha.

Viewing all articles
Browse latest Browse all 1768

Trending Articles