Why fading with alpha don't completely erases after some time?
in
Programming Questions
•
1 year ago
Calling fill(color, alpha) and then rect(0,0,width,height) should after some frames erases what was draw before, but it's not happening. See the example below... why is that?
thanks
- int br, bg, bb;
- color actualColor;
- color backColor = (120);
- PFont font;
- void setup()
- {
- size(340, 150);
- font = createFont("Arial", 15);
- br = 120;
- bg = 120;
- bb = 120;
- background(120);
- noStroke();
- fill(255);
- ellipse(width/2, height/2, 60, 60);
- frameRate(10);
- }
- void draw()
- {
- fill(120, 10); // try differents alpha values... even big values wont complete erase..
- // even with 180 but with some values like 18 it goes...?
- rect(0, 0, width, height -35);
- // for proper display of numbers
- fill(120);
- rect(0, height - 35, width, height);
- actualColor = get(width/2, height/2);
- int r = int(red(actualColor));
- int g = int(green(actualColor));
- int b = int(blue(actualColor));
- textFont(font, 15);
- String colorData = ("actual ellipse color: r" + nf(r, 3) + " g" + nf(g, 3) + " b" + nf(b, 3) );
- fill(255);
- text(colorData, 10, height -5);
- }
1