logical bitshift for RGB values

referenced from here

In RGB you have 8 bits for Red, 8 bits for Green and 8 bits for Blue. You are storing the 3 bytes in an int, which has 4 bytes in this way:

  • Bits from 0-7(least significant) for Blue.
  • Bits from 8-15(least significant) for Green.
  • Bits from 16-23(least significant) for Red.