public void testColorNewColorButtonChangesStandard() {
    int numberOfColorsToTest = 20;

    assertTrue("Waiting for DrawingSurface", mSolo.waitForView(DrawingSurface.class, 1, TIMEOUT));
    mSolo.clickOnView(mButtonTopColor);
    mSolo.sleep(COLOR_PICKER_DIALOGUE_APPERANCE_DELAY);

    TypedArray presetColors = getActivity().getResources().obtainTypedArray(R.array.preset_colors);

    numberOfColorsToTest = Math.min(numberOfColorsToTest, presetColors.length());

    for (int counterColors = 0; counterColors < numberOfColorsToTest; counterColors++) {
      Log.d(PaintroidApplication.TAG, "test color # " + counterColors);
      Button colorButton = mSolo.getButton(counterColors);

      if (!(colorButton.getParent() instanceof TableRow)) {
        Log.d(
            PaintroidApplication.TAG, "button parent is no table row: " + colorButton.getParent());
        continue;
      }

      mSolo.clickOnButton(counterColors);
      mSolo.sleep(200);
      int colorColor = presetColors.getColor(counterColors, 0);

      String buttonNewColorName = getActivity().getResources().getString(R.string.done);
      Button button = mSolo.getButton(buttonNewColorName);
      Drawable drawable = button.getBackground();
      int buttonTextColor = button.getCurrentTextColor();

      Bitmap bitmap = drawableToBitmap(drawable, button.getWidth(), button.getHeight());
      int buttonColor = bitmap.getPixel(1, 1);
      assertEquals("New Color button has unexpected color", colorColor, buttonColor);
      assertTrue(
          "Button textcolor and backgroundcolor ar the same", buttonColor != buttonTextColor);
      assertTrue(
          "Unexpected text color in butten text",
          (buttonTextColor == Color.BLACK || buttonTextColor == Color.WHITE));
      assertTrue(
          "Color not set yet", colorColor == mTopBar.getCurrentTool().getDrawPaint().getColor());
      bitmap.recycle();
      bitmap = null;
    }
  }
  /** Returns the text color of the Button in a BUTTON Type SuperCardToast. */
  public int getButtonTextColor() {

    return mToastButton.getCurrentTextColor();
  }