oki i'll help explain this for you and others...
computer graphics work from the primary colours Red, Green and Blue. For this reason, any colour setup requires to be divided into these 3 colours.
24-bit can be divided into 8

this tells us that the setup is 8-8-8 ... as an 8-bit value is 0-255 (256) this is where we get the RGB(0-255,0-255,0-255) from.
hopefully this all make sense so far
now db uses 16-bit colour in memblocks, this is due to the fact that it saves alot of space!
however as you might notice 16 / 3 doesn't give you a nice number

and as you can't have float bits (as bits are delt with in binary and there is only 1 or 0) - so from this fact 2 formats of 16bit were developed.
5-5-5 and the common 5-6-5 ... now unlike 24bit which is actually in 3x Byte values 16-Bit colour is in a single word value.
So what we need to do is find out what the values for each bit section - which is where the bitshift function comes in

now there are 3 values which aren't 0-255, so what is the last step is to divide into a 255 value.
1-bit 2 colours
2-bit 4 colours
4-bit 16 colours
8-bit 256 colours
16-bit 65535 colours
24-bit 4million colours
32-bit 16million colours

hope this make everything a little more sense now
Anata aru kowagaru no watashi! 