This does seem pretty weird. According to the docs, any 0x00000000 format hex number ought to be interpreted as 0xAARRGGBB, but as @GoToLoop said, if the AARRGG digits are zero then it interprets the BB digits as grayscale. eg. this creates a white circle:
size(400,400);
color c = 0x000000FF;
stroke(c);
noFill();
circle(200,200,50);
Granted, if you want fully transparent you have plenty of other values you can set the RGB values to that still work. But this still seems off, and doesn’t match any documentation I can see.
Yeah, I can see how it makes sense as an artifact of how colors are stored behind the scenes. It still doesn’t match how colors are described in the docs though.
Maybe descriptions of 0x color literals in the docs should have a footnote re: how 00 alpha values have a surprise in store?
But as we know, there are many aspects to processing. But as we know, there are many moments in processing where implicit transformations in values occur, something that could not be done in Java, at least not written in hex as "#AABBCCDDFF”.
It becomes unclear where processing additionally converts itself into the required value, and where to expect default behavior regarding colors, etc.
On Processing’s IDE (PDE) we can write code on both “.pde” & “.java” files.
By default, the PDE creates a “.pde” file as a new tab; but we can explicitly append a “.java” extension to it.
When we hit the PDE’s run button, all “.pde” files are concatenated as 1 single file.
Then the PDE applies its “pre-processor”, which will convert that concatenated file to an actual Java syntax-valid file as 1 PApplet subclass!
That’s when non-valid Processing syntax stuff (like the # color literal, the keyword color, etc.) are transpiled to their corresponding Java valid syntax.
We can even check that new “.java” file created by the “pre-processor”, so we can learn how Processing syntax is transpiled to Java’s.
However, the “pre-processor” won’t syntactically touch any “tab” files w/ the “.java” extension; but they will be compiled together w/ the transpiled unified “.pde” files though.
I am sharing some references to stroke(0x00000000) not giving a transparent color.
This is what is happening under the hood (other methods as well) and discusses why this breaks and the solution:
The reference (more than one function impacted) would certainly benefit from a comment highlighting this issue or link to the Wiki: stroke() / Reference / Processing.org