code: public static boolean colorMatches(Color color, int tolerance, Pixel[] pixels) {
          if (tolerance < 0 || tolerance > 255)
              throw new RuntimeException("Tolerance value must be between 0 and 255 inclusive");
          if (tolerance == 0)
              return uniform(color, pixels);
          else
              return approx(color, tolerance, pixels);
      }
docs: Returns true if the colors of all pixels in the array are within the given tolerance
  compared to the referenced color