Refactored how colors for the map are computed.