title: COLORREF to RGB
body: <p>I'm trying to use JavaScript to convert a <code>COLORREF</code>:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd183449.aspx" rel="nofollow noreferrer"><code>COLORREF</code></a>:</p>
  
  <blockquote>
    <p>When specifying an explicit RGB color, the COLORREF value has the
    following hexadecimal form:</p>
    
    <p>0x00bbggrr</p>
    
    <p>The low-order byte contains a value for the relative intensity of red;
    the second byte contains a value for green; and the third byte
    contains a value for blue. The high-order byte must be zero. The
    maximum value for a single byte is 0xFF.</p>
    
    <p>To create a COLORREF color value, use the RGB macro. To extract the
    individual values for the red, green, and blue components of a color
    value, use the <strong>GetRValue</strong>, <strong>GetGValue</strong>, and <strong>GetBValue</strong> macros,
    respectively.</p>
  </blockquote>
  
  <p>I know about <code>UInt32Array</code> but I don't know how to use it.</p>
  
  <p>How can I convert from COLORREF to RGB?</p>
  
  <p>It should be the opposite of this function I found:</p>
  
  <pre><code> cssColorToCOLORREF: function(csscolor) {
     let rgb = csscolor.substr(1);
     let rr = rgb.substr(0, 2);
     let gg = rgb.substr(2, 2);
     let bb = rgb.substr(4, 2);
     return parseInt("0x"+bb+gg+rr);
   },
  </code></pre>