Here is a little test case that illustrates my puzzle.
-
In both c1 and c3, alpha is set to 255. We should see the fill value showing over the background as declared via the RGB values, and this is what happens. In c1 we see a black rectangle, and in c3 we see a white one. (Hurrah.)
-
In both c2 and c4, alpha is set to 0. I think we should NOT be seeing the fill value showing up at all in both cases. What happens should be the opposite of what happens with the alpha value at the other extreme. c4 behaves as expected. c2 puzzles me. I think it should be the same as c4.
What am I missing here? Thanks for any hints and tips…
p.s. I can make it “behave” by setting c2 to color(1, 1, 1, 0); or to color(0, 0, 0, 1) - but this makes zero sense to me
xx
background(#E4E3E8);
size(300,300);
background(#E4E3E8);
color c1 = color(0, 0, 0, 255);
color c2 = color(0, 0, 0, 0);
color c3 = color(255, 255, 255, 255);
color c4 = color(255, 255, 255, 0);
fill(c1);
rect(75, 25, 50, 100);
fill(c2);
rect(150, 25, 50, 100);
fill(c3);
rect(75, 150, 50, 100);
fill(c4);
rect(150, 150, 50, 100);
fill(0);
text("c1: RGB0+MaxAlpha", 50, 20);
text("c2: RGB0+MinAlpha", 175, 20);
text("c3: RGB255+MaxAlpha", 50, 195);
text("c4: RGB255+MinAlpha", 175, 195);