title: How to make if statement with color code
body: <p>I got a little problem, what I think, can't be hard.
  but somehow, I miss that "can't be hard" part :).</p>
  
  <p>I got a code, that reads the colors of an image:</p>
  
  <pre><code>bmp = BitmapFactory.decodeResource(getResources(), R.drawable.four_colors);
  
  
      //define the array size
      rgbValues = new int[bmp.getWidth()][bmp.getHeight()]; 
  
      //Print in LogCat's console each of one the RGB and alpha values from the 4 corners of the image
      //Top Left
      for (int j = 0; j &lt; 1000; j++){
          for (int k = 0; k &lt; 1000; k++){
      Log.i("Pixel Value", "pixel x="+j +k + Integer.toHexString(bmp.getPixel(j, k)));
      test = Integer.toHexString(bmp.getPixel(j,  k));
  
  
          }
      }
  
      //get the ARGB value from each pixel of the image and store it into the array
      for(int i=0; i &lt; bmp.getWidth(); i++)
      {
          for(int j=0; j &lt; bmp.getHeight(); j++)
          {
              //This is a great opportunity to filter the ARGB values
              rgbValues[i][j] = bmp.getPixel(i, j);               
          }   
      }
  
      System.out.println(PixelNumber);
      System.out.println(test);
  }
  </code></pre>
  
  <p>This code works like a charm.
  But I tried to implement an if statement like:</p>
  
  <pre><code>if (color == black){
      number++;
  }
  </code></pre>
  
  <p>So every pixels he sees that is black, he must increase the number with 1.</p>
  
  <p>Tried almost everything I could came up to make a good if statement around this code, but nothing seems to work.
  So what is the correct place and if statement to make in this code?</p>
  
  <p>And maybe if you got more time (do not put too much effort in this if you don't want) is it possible to check on a color-range instead of 1 color only, So it picks all green colors. (same as Color range in photoshop).</p>