title: How to unpack uint32_t colour in c++
body: <p>I currently have a uint32_t variable that stores the rgb colours of a pixel.
  It looks like:</p>
  
  <pre><code>uint32_t colour = (255&lt;&lt;24) + (int(red)&lt;&lt;16) + (int(green)&lt;&lt;8) + int(blue);
  </code></pre>
  
  <p>where the variables red green and blue are values up to 255. I would like to take this uint32_t and unpack it so I can separate out the individual colour values. I would then like to store these individual values in an array</p>
  
  <pre><code>  color[0] = ; // red integer between 0 and 255
    color[1] = ; // green integer between 0 and 255
    color[2] = ; // blue integer between 0 and 255
  </code></pre>
  
  <p>Thanks for your help.</p>