title: Parse digits from integer
body: <p>I need to make a function that will fill a <code>Rectangle</code> with a color.
  The method looks like this </p>
  
  <pre><code>public void fillRect(Rectangle rect, int color)
  {
      int red = color;
      int green = color;
      int blue = color;
      g.setColor(new Color(red, green, blue));
      g.fillRect(rect.getX(), rect.getY(), rect.getW(), rect.getH());
  }
  </code></pre>
  
  <p>I would like to use an integer as parameter, for example <code>200100150</code> 
  which would result in the value <code>200</code> for red (only the three first digits).</p>
  
  <p>Is it possible to do this width java?</p>