JS: Remove everything after nth interation of chacter
<p>Trying to convert RGBA to HEX, discarding the transparency. There are a number of ways to convert RGB to HEX, and it seems the simplest way to get HEX out of RGBA is to simply discard the content of the alpha.</p>

<p>Hoping to turn this:</p>

<p><code>rgba(255,255,255,0.95)</code></p>

<p>Into this:</p>

<p><code>rgb(255,255,255)</code></p>

<p>Then use this:
<a href="http://haacked.com/archive/2009/12/29/convert-rgb-to-hex.aspx" rel="nofollow">http://haacked.com/archive/2009/12/29/convert-rgb-to-hex.aspx</a></p>

<p>to get <code>#FFFFFF</code></p>

<p>Open to a direct conversion as well, this just seems like a simple substring operation which eludes me at the moment.</p>
