title: Temporarily change color of a button when clicked
body: <p>I need to temporarly change the background color of a clicked button for 0.5 seconds and then want it to revert back to the original color.</p>
  
  <p>I have tried using pausetransition but im really new to java and am not sure how to use it correctly. Right now the best I can do is get he button to stay at the new color when clicked.</p>
  
  <pre><code>       Color[] colors = new Color[]{Color.DARKORCHID,Color.SALMON,Color.SPRINGGREEN,Color.GOLD};
          Color randomColor = colors[(new Random().nextInt(4))]; 
          button.setBackground(new Background(new BackgroundFill(randomColor,null,null)));
          grid.add(button, column, row);
           button.setOnAction(new EventHandler&lt;ActionEvent&gt;(){
            public void handle(ActionEvent e){
               Button b = (Button)e.getSource();
               Button save = b;
               b.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY,null,null)));
            }
          });
  }
  </code></pre>
  
  <p>This right now is just changing the color to grey. If I could figure out how to get the color to temporarily change OR even change back when clicked again. Another part of my issue is that all the buttons have different colors.
  Any tips or help would be appreciated.</p>