Err, your skin colour is very much affected by your genes, all of which affect how, and how much, melanin is produced by your skin cells. It's worth noting that people with lighter skin, have ineffective, or faulty versions which cause their skin not to develop as much melanin as our (very distant) ancestors once did. It's hypothesised that although this leaves people more at risk of sun burn and skin cancers, it does allow them to produce more vitamin D in the lower levels of sunlight in the northern hemisphere.
Although, of course, the other large factor is how much time you spend in the sun, even I can get a respectable tan if I spend a lot of time outside in the sun and I'm pasty as fsck.