Emerging mobile mapping applications create new constraints for cartographers. These constraints should be considered in addition to the traditional cartographic rules used to design maps. Legend colors could be optimized regarding those constraints. A challenge for optimization concerns the preservation of map semiotic quality. In our research, we propose a quantification of the cartographic quality of a map, regarding a given reference map that considers semantic rules of association, differentiation and order conveyed by map colors. Some mobile devices require less energy to display dark colors than lighter ones. In this paper we consider the energy consumption as the contextual constraint to optimize. Map samples are designed, while taking into account some conventional uses of colors for relevant themes: hydrography, vegetation and the background layer. We discuss how to find the best compromise between a contextual constraint (the energy required to display a map on a screen of a mobile device in our example) and the cartographic consistency on colors regarding the initial semantic relationships in the legend. We answer the question of how much can cartographic rules be altered while still preserving semiotic quality.