title: Generate random "dark" colours only in Java
body: <p>So I have the following method for generating random colours that I use in my application:</p>
  
  <pre><code>public final Color generateRandomColour() {
  
      return Color.getHSBColor(new Random().nextFloat(),
              new Random().nextFloat(), new Random().nextFloat());
  }
  </code></pre>
  
  <p>I get a range of different colours, but as I'm using these colours to paint "rectangles" in Swing on a background with light colours, I'm interested in generating colours which are relatively dark. The background is a light grey so sometimes the generated random colours are also light grey which makes it hard to see the rectangles.</p>
  
  <p>I've tried to put a cap on the max float values but it doesn't seem to get me darker colours only. Any help appreciated.</p>