title: Why do we use >> to get colour values from RGB?
body: <p>I know that to get colour values from rgb you use</p>
  
  <pre><code>b = rgb &gt;&gt; 0
  g = rgb &gt;&gt; 8
  r = rgb &gt;&gt; 16
  </code></pre>
  
  <p>Could someone explain why this works? Each of those is 8 bits right? Doesn't >> n give the first n bits? How does it work for b and r as well?</p>