Need some tips with how to convert a hexadecimal color value to a rgb() one
<p>I just started reading <em>Object-Oriented JavaScript</em> and am stuck on an exercise.  </p>

<p>On page 91 it asks to write a function that converts a hex color into its RGB equivalent (eg "rgb(0,0,255)"). It requires that you pull in the full string including the '#'. </p>

<p>After reading through the two chapters he has spent on explaining data types, loops, conditions,and functions I don't know how to parse the hex value without cheating and using some sort of string function - something he hasn't even covered at this point. </p>

<p>Is there a way you can do this exercise using only the functions and methods he's demonstrated in the book?  He asks that javascript return <strong>"rgb(0,255,0)"</strong> if the following code is entered:</p>

<pre><code>var a = getRGB("#00FF00");
a;
</code></pre>

<p>I'm assuming you would need to break up the hex value into an array for the r,g and b values using a loop and then recombine them into the string.  If possible, please don't give me the entire solution but any helpful hints would be greatly appreciated.  Thanks for any help.</p>
