I don't understand get() very well
in
Programming Questions
•
2 years ago
Hi,
I'm trying to use the get() method to tell me colors...so I can make a button map behind an image.
When I click on a red color I made in photoshop with the rgb of (255,0,0)...get() will return all sorts of different numbers. Same with (0,255,0) etc. It isn't consistent. It is giving me for (255,0,0): -260350, -64256, -196352, -131072, etc. Why is this? Why doesn't it return the same color value every time?
I am using code like this:::
void mousePressed(){
color c = myImage.get(mouseX,mouseY);
println(c); //(to test out);
if (colors[3] == c){ ///////////the colors[3] in the array would be a number i get back from get() like -256 or -196352..
snip[3].trigger(); play a sound /////////////I tried making in an RGB value but that didn't work...
}
Thanks for any help!
I'm trying to use the get() method to tell me colors...so I can make a button map behind an image.
When I click on a red color I made in photoshop with the rgb of (255,0,0)...get() will return all sorts of different numbers. Same with (0,255,0) etc. It isn't consistent. It is giving me for (255,0,0): -260350, -64256, -196352, -131072, etc. Why is this? Why doesn't it return the same color value every time?
I am using code like this:::
void mousePressed(){
color c = myImage.get(mouseX,mouseY);
println(c); //(to test out);
if (colors[3] == c){ ///////////the colors[3] in the array would be a number i get back from get() like -256 or -196352..
snip[3].trigger(); play a sound /////////////I tried making in an RGB value but that didn't work...
}
Thanks for any help!
1