code: public static boolean isAllOneColor( BufferedImage image ) {
          int width = image.getWidth();
          int height = image.getHeight();
          int previousRgb = 0;
          boolean isFirst = true;
          for( int x = 0; x < width; x++ ) {
              for( int y = 0; y < height; y++ ) {
                  int rgb = image.getRGB(x, y);
                  if (isFirst) {
                      isFirst = false;
                  } else {
                      if (rgb != previousRgb) {
                          return false;
                      }
                  }
                  previousRgb = rgb;
              }
          }
          return true;
      }
docs: Checks if an image is all of one color.
  
  @param image the image to check.
  @return <code>true</code> if the image is all of the same color.