color data type is not recognized in eclipse

edited January 2014 in Questions about Tools

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.

code

Any ideas would be greatly appreciated.

Thanks, David.

Answers

  • Answer ✓

    color is a processing addition, it's basically a renamed int. try using 'int' instead.

  • edited January 2014 Answer ✓

    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:-O

  • Answer ✓

    Something 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.

Sign In or Register to comment.