Is "color" actually an object?

I've been looking through the core documentation for the definition of the color datatype. I cannot seem to find it. I know the traditional way to store a 3-value color is in an int, and that you can manually set a color to a hex value, which would suggest it's a 4 byte int. Further, the color() assignment methods in PApplet return integers, for example.

So is color really just an int? Does the preprocessor just change declarations of color to int? Thanks.


  • Answer ✓

    Hit CTRL + SHIFT + E in order to export any sketch w/ keyword color on it.
    Check the generated ".java" file and you'll see all color keywords were transpiled to int. ;))

  • Thanks, I guess it's a clever way to get around the lack of typedefs

Sign In or Register to comment.