Alpha channel problem
in
Programming Questions
•
1 year ago
I wonder if this is known or even documented behavior, but I couldn't find it anywhere.
- void setup() {
- size(100, 100);
- color col1 = color(0, 0);
- color col2 = color(1, 0);
- fill(col1);
- rect(10, 10, 20, 80); // black rectangle
- fill(col2);
- rect(40, 10, 20, 80); // transparent rectangle
- fill(0, 0);
- rect(70, 10, 20, 80); // transparent rectangle
- }
The first rectangle is drawn fully opaque although the alpha channel is 0. This does not depend on the rendering method (standard, P2D, OPENGL). All rectangles are drawn as I would expect if the alpha channel is 1 (or any other value) rather than of 0.
1