Best way to think of it:
The hexadecimal codes do this:
RedRedGreenGreenBlueBlue
So the value of 000000 contains no color, and is therefore black. Naturally, the value of FFFFFF contains all colors, and is white. Using the RRGGBB rubric: FF0000 is red, 00FF00 is green, and 0000FF is blue.
Mixing these colors is just like mixing paints, so if we combine red and blue (FF00FF) we get a purple/pink.
The Hex values range from 0 to 9, and from A to F.