Hyperpigmentation, like many of your other pregnancy symptoms, is the result of your pregnancy hormones, namely your increased progesterone and estrogen levels. The extra progesterone and estrogen in your body causes your body to produce more melanin, the substance responsible for the darkening of your skin.
Hyperpigmentation is most notable in the parts of your body that are naturally darker. These include: your groin area, areolae, freckles, moles, underarms and scars. Hyperpigmentation is also responsible for chloasma and your linea nigra.
Unfortunately, hyperpigmentation is unavoidable and untreatable during pregnancy. However, it does fade in the months following birth and its effects can be reduced by limiting your exposure to sun and wearing sun block, even if you are staying inside.