Eggplants tend to darken when cooked.  They usually lose the beautiful purple when heated. Adding acidity and/or salt to the eggplant before cooking helps preserve its color.