You’re doing alright! It’s a PDE’s pre-processor bug!
B/c the name color is both a Processing’s datatype: color
And a PApplet & PGraphics method name: color()
It seems like the name color can’t be used w/ the dot .
operator within a “.pde” file.
This example calling color() as a method of a PGraphics object also triggers this bug:
final PGraphics pg = createGraphics(10, 10);
pg.color(0); // unexpected token: .
exit();
As a workaround, you can place your static classes in a “.java” file instead.
You just need to remove the static
keyword before class
, b/c top classes inside “.java” files are implicitly static already.
You should also report this issue on Processing’s repo: