title: get r, g, b component of a color in rgb() format
body: <p>I am getting "rgb(18, 115, 224)" from a dom element. Now I want to assign the color(whatever i am getting from this element) to a span element. So I need hexadecimal equivalent of the color I am getting. For this I can use </p>
  
  <pre><code>"#" + componentToHex(r) + componentToHex(g) + componentToHex(b)
  </code></pre>
  
  <p>but, My question here's how can I get the r, g,b component values from "rgb(18, 115, 224)"</p>