title: Bit Shift and Bitwise operations to encode RGB values
body: <p>I would like to encode the RGB color to a single integer value.</p>
  
  <p>Let's say the algorithm for encoding is like this:</p>
  
  <pre><code>int code = (blue * 256 * 256) + (green * 256) + red
  </code></pre>
  
  <p>How can encode/decode RGB components to/from the code using bit shift and/or bitwise operators?</p>