We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to use eclipse (installed via the android adt package) as an IDE for Processing. Most things seem to work, but I can't get eclipse to recognize the color data type.
here is a screen shot showing example code and the error indicators next to the lines that create or use a variable of type color.
Any ideas would be greatly appreciated.
Thanks, David.
Answers
color is a processing addition, it's basically a renamed int. try using 'int' instead.
Processing got many syntactic sugar features to make it more palatable for artistic new-comers! :-\"
That makes it lose compatibility w/ Java and can't be compiled w/o removing those candies! :P
Processing got a pre-processor which turns its non-compliant Java into 100% Java!
However, if we go astray and use another IDE, we're on our own! :o3
Seems like you've bumped in a very interesting 1 -> Sugar primitive data-type
color
! =))That doesn't exist in Java! Actually, it is merely the common primitive data-type
int
! 3:-OSomething to read before using Eclipse: http://processing.org/tutorials/eclipse/
OK, thanks! Changing the type to int worked. And now I see what I missed in the reference materials: in the Processing reference for color(), if I had looked all the way down, it says color() returns an int! I didn't look past the paragraph that begins "Description: Creates colors for storing in variables of the color datatype" and assumed that meant it returned a color and that a color was a primitive in addition to int.
Thanks again. You guys are unbelievably helpful.