Morchella sextelata, a highly sought-after edible mushroom worldwide, is evaluated based on its cap color as an essential commercial property indicator. In the present study, the effects of blue light on cap pigmentation in M. sextelata, as well as the synthesis and structural characteristics of melanin pigments within the cap were examined. The results showed that an increase in the proportion of blue light within the lighting environment promoted melanin synthesis and melanization of the cap. Transmission and scanning electron microscopy revealed the localization of melanin within the mycelium and its ultrastructural characteristics. The UV–visible analysis demonstrated that melanin exhibited a maximum absorption peak at 220 nm and possessed high alkaline solubility as well as acid precipitability. The structural characteristics of melanin were analyzed using FTIR, NMR, HPLC, and elemental analysis, which confirmed the presence of eumelanin, pheomelanin, and allomelanin in both brown and black caps. Furthermore, blue light can stimulate the synthesis of both eumelanin and pheomelanin. The obtained results can serve as the foundation for comprehending the mechanism by which light regulates color formation in mushrooms.