title: Convert a RGB colour value to Decimal
body: <p>How do I convert a RGB colour value to just plain decimal?</p>
  
  <p>So I have: RGB(255,255,255) is white<br>
  Its decimal equivalent is: 16777215</p>
  
  <p>I have tried thinking it might just be:</p>
  
  <pre><code>var dec = r*g*b; // but this doesn't work
  </code></pre>
  
  <p>Although that doesn't work.</p>
  
  <p>Anyone know of the algorithm/equation to convert from RGB (or rgba) to decimal?</p>