Melanin production is influenced by genetic, environmental, and hormonal factors. Exposure to ultraviolet (UV) radiation from the sun stimulates melanocytes to produce more melanin as a protective mechanism. Hormonal changes, such as those occurring during pregnancy or in certain endocrine disorders, can also affect melanin production. Additionally, genetic factors determine the baseline level of melanin production, influencing skin color.