Hi everybody! So, I’ve had this question for a while now. It appears the type color in java is equivalent to the int type in every single way, to the point that the built-in java compile-time error checker (I wish I knew what it was called) literally just refers to it as “the type int”.
I figured for a while that somewhere in the Processing core source code, there was just a line of code that said typedef int color (but in Java). Today, however, I looked into it, and found there’s no such thing as typedef in java, nor is there any equivalent. The closest thing you can do is write a class that extends the class you want to typedef, but this does not work on int because it’s a primitive, and it does not work on Integer because it’s a final class. Furthermore, after taking the source code, grepping for the word “color”, and lightly skimming the results, I couldn’t really find anything that might clue me in to how this works. So, my question is, how did they do it? And, if possible, how could I do the same thing in my code?