Skin color depends on melanogenesis: the production of a brown pigment known as melanin by melanocytes, a specialized cell located in the epidermis.
Melanin is evenly distributed at the surface of the skin in the shape of "grains". It gives the skin its shade of color, ranging from milky white to black: the higher the concentration of melanin, the darker the skin. Melanin synthesis, and thus the skin's color, is genetically determined.
Melanin synthesis is also stimulated by the sun rays. In fact, tanning is your skin's reaction to the aggression of ultraviolet rays.
Pigmentation is fragile and easily altered by trauma or diseases. "Pigmentation problems" can take the form of hyperpigmentations (brown spots) or hypopigmentations (clear spots).