(define -ayalog '())

括弧に魅せられて道を外した名前のないプログラマ

Eclipse×Processingでcolorを使いたい。

ちょっと偶然見つけたので書き残しておく。

以下のリンクに書いてあるけど、Eclipseでのcolorの使い方をググってて少なくとも日本語記事はそんなになかったので。
Processing in Eclipse

Another important note. The Processing "color" primitive does not exist in Java. In fact, in Processing a "color" is really just an integer (32 bits with red, green, blue, and alpha components). Processing translates "color" to "int", but Eclipse won't do that for you. So instead of saying:

color pink = color(255,200,200);

you should say:

int pink = color(255,200,200);

and if you are in another class and have to refer to the "parent" PApplet:

int pink = parent.color(255,200,200);

For more, check out this Eclipse as Editor tutorial by creativecoding.org.

こう書いてあったわけだけど、簡単に書きなおせば「colorっていう型はJavaに存在しないし、実際にはint型です。だから次のように書いてください」ってとこかな?
実際に書くなら

int c = color(255,200,200);

もしくはPAppletを継承していないクラスから利用するなら

PApplet p; //コンストラクタで初期化する
//〜〜〜〜〜〜〜〜〜
//何かしらのメソッドで
int c = p.color(255,200,200);

こう書くかってとこか。