Since binary is base-2, then every shift to the left represents a doubling of the value. A shift to the right gives a value of half or 0.5 less than half since there are no decimals in binary.

```
3 << 1 == 6
3 >> 1 == 1
```

Going to look at your code now. Will return…

Your code is correct, so you must have had help or it was given in the instructions. Let’s run this in the console…

```
>>> x = int('FFFFFF', 16)
>>> x % 256
255
>>> x = x >> 8
>>> x % 256
255
>>> x = x >> 8
>>> x
255
>>>
```

The first modulo is the blue value. To remove that from the full value we shift the number 8-bits to the right. The 8-bits there were on the right side are now dropped. The second modulo is the green value. Again, to remove those bits we shift one more time, 8-bits to the right. The value that remains is for red.

Let’s try this one another number,

```
>>> x = int('0FF0FF', 16)
>>> x % 256
255
>>> x = x >> 8
>>> x % 256
240
>>> x = x >> 8
>>> x
15
>>>
```