color can not resolved to a type?

Copy a file which run in processing itself well, but when put into eclipse, it shows " color can not resolved to a type"? what's matter? what jar shall I import else? 2] the float type can not be identified and have to cast, why? how shall I config to need not cast?

Tagged:

Answers

  • When I try to change color to Color, it seems could do a trick, but will introduce many other problems.

  • Answer ✓

    Keyword color doesn't exist in Java! It's Processing's syntax sugar for keyword int! b-(

  • When I change color to Color, it seems to do the trick, but many other problems were entered.

    review the color definition in processing, it seems to have a reture int value. color(r,g,b);

  • Answer ✓

    When I change color to Color

    that's using a different Color, possibly java.awt.Color - a completely different (wrong) thing. use int instead.

    floats will also need to be defined with a trailing f:

    float a = 1.0f;

    again this is something processing does to make it easier but which eclipse doesn't.

  • oh, I c, you are right. it's processing's syntax sugar.

  • I really forget the suffix f!!. thanks.

  • thank you all.

  • You should start by reading the http://processing.org/tutorials/eclipse/ tutorial...

Sign In or Register to comment.