Processing bug?

To add to what @quark said

  • Calling the .color() method on a PGraphics object should be valid, because PGraphics defines all the drawing methods like .line(), .stroke(), .rect(), and also .color().
  • Defining methods called color(), line(), or any other Processing keyword inside your class does work. Defining a method called draw() inside a class is actually common practice (for particles, for instance), although it may confuse less experienced users by making them think they are somehow Processing related.
  • Defining a method called float() is not ok, but not because it’s a Processing keyword, but because it’s a Java Keyword.
3 Likes