Body coloration affects how animals interact with the environment. In insects, the rapid evolution of black and brown melanin patterns suggests that these are adaptive traits. The developmental and molecular mechanisms that generate these pigment patterns are largely unknown. We demonstrate that the regulation and function of the yellow and ebony genes in Drosophila melanogaster play crucial roles in this process. The Yellow protein is required to produce black melanin, and is expressed in a pattern that correlates with the distribution of this pigment. Conversely, Ebony is required to suppress some melanin formation, and is expressed in cells that will produce both melanized and non-melanized cuticle. Ectopic expression of Ebony inhibits melanin formation, but increasing Yellow expression can overcome this effect. In addition, ectopic expression of Yellow is sufficient to induce melanin formation, but only in the absence of Ebony. These results suggest that the patterns and levels of Yellow and Ebony expression together determine the pattern and intensity of melanization. Based on their functions in Drosophila melanogaster, we propose that changes in the expression of Yellow and/or Ebony may have evolved with melanin patterns. Consistent with our hypothesis, we find that Yellow and Ebony are expressed in complementary spatial patterns that correlate with the formation of an evolutionary novel, male-specific pigment pattern in Drosophila biarmipes wings. These findings provide a developmental and genetic framework for understanding the evolution of melanin patterns.