We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi, i'm new in processing Currently i'm doing a camera colour pixel related app. ---(White=255,Black=0) everything works fine but i can't add range of colours to it i can only set a colour, or a range to darkest black( total/3 < 60) which i don't want i want to set a range of (ligthen)black to grey (e.g) 40 to 60 my code is as follow:
float r = red(cam.pixels[loc]);
float g = green(cam.pixels[loc]);
float b = blue(cam.pixels[loc]);
float total = r+g+b;
if (total/3 > 238)
{
try
{......
}
else if (total/3 == 60 ) //problem here
{......
}
Answers
I am sorry, but I find your question unclear... (and is it really related / specific to Android mode?)
I don't see what the
try
is doing there. Nor what you try to do exactly.Perhaps the answer is to just use && (logical AND).
Note that == doesn't work with floating-point numbers! (in general)
it's for android mode, the 'try' was actually doing something for the bottom part coding. Anyway thanks! then code works fine! thanks so much ;)