title: Generate a Random Color Java
body: <p>I am trying to create a random color by randomly generating numbers for R,G, and B values with a random number generator, and using the values to make a color. The following code is in my <code>onCreate()</code> method:</p>
  
  <pre><code>Random rand = new Random();
      // Java 'Color' class takes 3 floats, from 0 to 1.
      float r = rand.nextFloat();
      float g = rand.nextFloat();
      float b = rand.nextFloat();
      Color randomColor = new Color(r, g, b);
  </code></pre>
  
  <p>How come eclipse tells me "The constructor <code>Color(float, float, float)</code> is undefined"? Shouldn't this work correctly?</p>