

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I have a photo which I load to a Bitmap. I checking color of some pixels. But in the picture sometimes something what should be for example red is a little bit more marron, magenta, orange etc, because of the light and other factors. I'm using method getPixel(x,y) which returns an int value of Color. Is any possibility to check if this int value is in interval which defines colors which are similar to red. Or is any website or something, where I can find any definitions or colors description?

share|improve this question

Yes. From, the Color integer is of the format 0xffRRGGBB. (The ff is actually an alpha channel, i.e. opacity, but is usually opaque hence ff).

There are many sites which will enable you to enter such values to get a look at the color - for example You could pick the outer bounds of each color component.

You might also consider using Color.colorToHSV() which will enable you to specify the bounds in terms of hue, saturation and brightness instead of red, green and blue - this may be logically easier in your context.

share|improve this answer
Thanks, I think this site will be very helpful for me!! – Ziva Feb 9 '13 at 19:43
No problem. If you're happy please accept the answer! – Adrian Taylor Feb 12 '13 at 20:53

Basicall RGB is not suitable for comparing colors, but there is a good color modell called HSV. So you should convert the RGB value to HSV then compare the Hue value of the colors with a threshold.

For example Hue value of the green color is 120, but you can accept the values between 90 and 150.

This link shows how to convert between the color modells:

More info about HSV modell:

share|improve this answer

Your Answer


