Correct colour for text when colour set
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 17 Sep 2014 15:41:14 +0000 (16:41 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 17 Sep 2014 15:41:14 +0000 (16:41 +0100)
src/jalview/gui/UserDefinedColours.java

index 3c87e4c..fec36e5 100755 (executable)
@@ -250,18 +250,19 @@ AlignmentPanel ap;
     if (selectedButtons != null)
     {
       JButton button = null;
+         final Color newColour = colorChooser.getColor();
          for (int i = 0; i < selectedButtons.size(); i++)
       {
         button = (JButton) selectedButtons.elementAt(i);
-        button.setBackground(colorChooser.getColor());
-        button.setForeground(brighterThan(button.getBackground()));
+        button.setBackground(newColour);
+        button.setForeground(brighterThan(newColour));
       }
       if (button == lcaseColour)
       {
         for (int i = 0; i < lowerCaseButtons.size(); i++)
         {
           button = (JButton) lowerCaseButtons.elementAt(i);
-          button.setBackground(colorChooser.getColor());
+          button.setBackground(newColour);
           button.setForeground(brighterThan(button.getBackground()));
         }
       }