title: Nimbus look-and-feel changes color of JButtons
body: <p>I have a JButton with an icon on it.
  I want the background color of the JButton to be the same as the icon.</p>
  
  <p>The following code works fine in the standard look-and-feel :</p>
  
  <pre><code>button.setBackground(new Color(212,208,199));
  </code></pre>
  
  <p>But when I change my look-and-feel to Nimbus, then the background color of the JButton is much lighter.</p>
  
  <p>The JButton still changes its background color when I change the color in button.setBackground(), but I have no idea to what color I need in Nimbus to get the same color as the background color of the JButton.
  Of course I could try to find the color by sight by trying all values, but there should be a simpler way.</p>
  
  <p>I also tried changing the background color via the following code, but with the same result :</p>
  
  <pre><code>UIDefaults defaults = UIManager.getLookAndFeelDefaults();
  defaults.put("Button.background",new Color(212,208,199));
  </code></pre>
  
  <p>How can I change the background color of my JButton in Nimbus, so that it merges with the background color of the containing icon ?</p>
  
  <p>Below are some pictures of the button with default LaF, nimbus LaF (same code), and nimbus LaF (red color) :</p>
  
  <p>Default LaF, using <code>button.setBackground(new Color(212,208,199))</code> :</p>
  
  <p><img src="https://i.stack.imgur.com/Yzfbk.png" alt="enter image description here"></p>
  
  <p>Nimbus LaF, using <code>button.setBackground(new Color(212,208,199))</code> :</p>
  
  <p><img src="https://i.stack.imgur.com/lvn0t.png" alt="enter image description here"></p>
  
  <p>Nimbus LaF, using <code>button.setBackground(Color.red)</code> :</p>
  
  <p><img src="https://i.stack.imgur.com/07aKs.png" alt="enter image description here"></p>