We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › cant find "color" variable type
Page Index Toggle Pages: 1
cant find "color" variable type (Read 1251 times)
cant find "color" variable type
Jan 1st, 2010, 10:34pm
 
im using elcipse ..i cant find the "color" variable type

they have used that in this example
http://processing.org/hacks/hacks:picking_color_buffer

i have already included this line into my code
import processing.core.*;

Re: cant find "color" variable type
Reply #1 - Jan 2nd, 2010, 12:45am
 
Processing uses the keyword "color" as an "int".

You can see the replacement in the .java files created by Processing.
Re: cant find "color" variable type
Reply #2 - Jan 2nd, 2010, 2:51am
 
Yes, that's part of the "magic" (pre-processing) that the PDE does behind the scene... You won't be able to write fill(#BADCAF) not int(floatVar) in Eclipse for example, because Processing changes that on the fly.
Re: cant find "color" variable type
Reply #3 - Jan 2nd, 2010, 8:11am
 
is that mean coding using eclispe is different  ?

so what is i hv to set the color white ?
background(255) in eclipse would result a blue one  not white

i sw in a example they hv used background(0xffffff) but its not simple
is there a function to convert from number values to color values ?



i like eclipse becos it gives ALL the available functions after i put a "dot" Smiley .very easy becos i dont hv to remember the names of the functions

if the processing IDE gv the same functionally no one would hesitage to use that for developing.
Re: cant find "color" variable type
Reply #4 - Jan 2nd, 2010, 9:25pm
 
A 'color' is an 'int'.
You can simply use "int c = color(255);" instead of "color c = color(255);"

If you export from the PDE, you can see what processing turns a 'color' into by opening the .java file it creates.
Page Index Toggle Pages: 1