title: Get a color component from an rgb string in Javascript?
body: <p>I'm using Javascript and Canvas to make a painting app and was using strings in this format to designate chosen colors:</p>
  
  <p><code>"rgb(255,0,0)"</code></p>
  
  <p>Because the canvas context fillStyle property takes in strings of that format.</p>
  
  <p>However, I now need to obtain individual components from this string and was wondering if there was a way to do it without messy string manipulation. Possibly some built in way to convert that string to a sort of color object and then access its r, g, and b components?</p>
  
  <p>Thanks.</p>