﻿Index: src/org/openstreetmap/josm/actions/SaveAction.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/actions/SaveAction.java b/trunk/src/org/openstreetmap/josm/actions/SaveAction.java
--- a/trunk/src/org/openstreetmap/josm/actions/SaveAction.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/actions/SaveAction.java	(working copy)
@@ -115,7 +115,7 @@
         // Ask for overwrite in case of GpxLayer
         if (f != null && layer instanceof GpxLayer && !Config.getPref().getBoolean("gpx.export.overwrite", false)) {
             JPanel p = new JPanel(new GridBagLayout());
-            JLabel label = new JLabel(tr("File {0} exists. Overwrite?", f.getName()));
+            JLabel label = new JLabel("<html>" + tr("The file \"{0}\" has been changed.<br>Would you like to overwrite the existing file?", f.getName()) + "</html>");
             label.setHorizontalAlignment(SwingConstants.CENTER);
             JCheckBox remember = new JCheckBox(tr("Remember choice"));
             remember.setHorizontalAlignment(SwingConstants.CENTER);
@@ -124,13 +124,16 @@
             ExtendedDialog dialog = new ExtendedDialog(
                     MainApplication.getMainFrame(),
                     tr("Overwrite"),
-                    tr("Overwrite"), tr("Cancel"))
-                .setButtonIcons("save_as", "cancel")
+                    tr("Overwrite"), tr("New file"), tr("Cancel"))
+                .setButtonIcons("save", "save_as", "cancel")
                 .setContent(p);
-            if (dialog.showDialog().getValue() != 1) {
+            int val = dialog.showDialog().getValue();
+            if (val == 1) {
+                Config.getPref().putBoolean("gpx.export.overwrite", remember.isSelected());
+            } else if (val == 2) {
                 f = null;
-            } else if (remember.isSelected()) {
-                Config.getPref().putBoolean("gpx.export.overwrite", true);
+            } else {
+                return null;
             }
         }
         return f == null ? layer.createAndOpenSaveFileChooser() : f;
Index: src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java b/trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
--- a/trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(working copy)
@@ -19,6 +19,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import javax.swing.BorderFactory;
 import javax.swing.JCheckBox;
@@ -32,11 +33,14 @@
 import javax.swing.border.EtchedBorder;
 import javax.swing.filechooser.FileFilter;
 
+import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapFrameListener;
+import org.openstreetmap.josm.gui.Notification;
+import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.util.WindowGeometry;
 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
@@ -58,6 +62,8 @@
     private transient Map<Layer, SessionLayerExporter> exporters;
     private transient MultiMap<Layer, Layer> dependencies;
 
+    private static final BooleanProperty SAVE_LOCAL_FILES_PROP = new BooleanProperty("session.savelocal", true);
+
     /**
      * Constructs a new {@code SessionSaveAsAction}.
      */
@@ -156,6 +162,32 @@
                 .filter(layer -> exporters.get(layer) != null && exporters.get(layer).shallExport())
                 .collect(Collectors.toList());
 
+        Stream<Layer> layersToSaveStream = layersOut.stream()
+                .filter(Layer::isSavable)
+                .filter(layer -> !(layer instanceof AbstractModifiableLayer) || ((AbstractModifiableLayer) layer).isModified())
+                .filter(layer -> exporters.get(layer) != null && !exporters.get(layer).requiresZip());
+
+        if (SAVE_LOCAL_FILES_PROP.get()) {
+            // individual files must be saved before the session file as the location may change
+
+            if (layersToSaveStream
+                .map(layer -> SaveAction.getInstance().doSave(layer, true))
+                .collect(Collectors.toList()) //force evaluation of all elements
+                .contains(false)) {
+
+                new Notification(tr("Not all local files referenced by the session file could be saved.<br>Make sure you save them before closing JOSM."))
+                    .setIcon(JOptionPane.WARNING_MESSAGE)
+                    .setDuration(Notification.TIME_LONG)
+                    .show();
+            }
+
+        } else if (layersToSaveStream.anyMatch(l -> l instanceof AbstractModifiableLayer)) {
+            new Notification(tr("Not all local files referenced by the session file are saved yet.<br>Make sure you save them before closing JOSM."))
+                .setIcon(JOptionPane.INFORMATION_MESSAGE)
+                .setDuration(Notification.TIME_LONG)
+                .show();
+        }
+
         int active = -1;
         Layer activeLayer = getLayerManager().getActiveLayer();
         if (activeLayer != null) {
@@ -241,6 +273,7 @@
         }
 
         protected final Component build() {
+            JPanel op = new JPanel(new GridBagLayout());
             JPanel ip = new JPanel(new GridBagLayout());
             for (Layer layer : layers) {
                 JPanel wrapper = new JPanel(new GridBagLayout());
@@ -263,7 +296,13 @@
             p.add(sp, GBC.eol().fill());
             final JTabbedPane tabs = new JTabbedPane();
             tabs.addTab(tr("Layers"), p);
-            return tabs;
+            op.add(tabs, GBC.eol().fill());
+            JCheckBox chkSaveLocal = new JCheckBox(tr("Save all local files to disk"), SAVE_LOCAL_FILES_PROP.get());
+            chkSaveLocal.addChangeListener(l -> {
+                SAVE_LOCAL_FILES_PROP.put(chkSaveLocal.isSelected());
+            });
+            op.add(chkSaveLocal);
+            return op;
         }
 
         protected final Component getDisabledExportPanel(Layer layer) {
Index: src/org/openstreetmap/josm/data/gpx/GpxData.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java b/trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
--- a/trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java	(working copy)
@@ -41,7 +41,7 @@
  *
  * @author Raphael Mack &lt;ramack@raphael-mack.de&gt;
  */
-public class GpxData extends WithAttributes implements Data {
+public class GpxData extends WithAttributes implements Data, IGpxLayerPrefs {
 
     /**
      * Constructs a new GpxData.
@@ -981,6 +981,7 @@
      * @return Modifiable map
      * @since 15496
      */
+    @Override
     public Map<String, String> getLayerPrefs() {
         return layerPrefs;
     }
@@ -1175,8 +1176,11 @@
      * @param value modified flag
      * @since 15496
      */
+    @Override
     public void setModified(boolean value) {
-        modified = value;
+        if (!initializing) {
+            modified = value;
+        }
     }
 
     /**
Index: src/org/openstreetmap/josm/data/gpx/IGpxLayerPrefs.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/data/gpx/IGpxLayerPrefs.java b/trunk/src/org/openstreetmap/josm/data/gpx/IGpxLayerPrefs.java
new file mode 100644
--- a/trunk/src/org/openstreetmap/josm/data/gpx/IGpxLayerPrefs.java	(nonexistent)
+++ b/trunk/src/org/openstreetmap/josm/data/gpx/IGpxLayerPrefs.java	(working copy)
@@ -0,0 +1,26 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.gpx;
+
+import java.util.Map;
+
+/**
+ * Interface containing the layer preferences.
+ * Implemented by GpxLayer and MarkerLayer
+ * @since xxx
+ */
+public interface IGpxLayerPrefs {
+
+    /**
+     * The layer specific prefs formerly saved in the preferences, e.g. drawing options.
+     * NOT the track specific settings (e.g. color, width)
+     * @return Modifiable map
+     */
+    Map<String, String> getLayerPrefs();
+
+    /**
+     * Sets the modified flag to the value.
+     * @param value modified flag
+     */
+    void setModified(boolean value);
+
+}
Index: src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java b/trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
--- a/trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(working copy)
@@ -1,6 +1,28 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.layer;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.stream.Collectors;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+
 import org.openstreetmap.josm.actions.AutoScaleAction;
 import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.actions.ExpertToggleAction.ExpertModeChangeListener;
@@ -41,27 +63,6 @@
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.date.Interval;
 
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.stream.Collectors;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trn;
-
 /**
  * A layer that displays data from a Gpx file / the OSM gpx downloads.
  */
@@ -592,6 +593,9 @@
 
     @Override
     public synchronized void destroy() {
+        if (linkedMarkerLayer != null && MainApplication.getLayerManager().containsLayer(linkedMarkerLayer)) {
+            linkedMarkerLayer.data.transferLayerPrefs(data.getLayerPrefs());
+        }
         data.clear();
         data = null;
         super.destroy();
Index: src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java b/trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
--- a/trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(working copy)
@@ -20,7 +20,9 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 
 import javax.swing.AbstractAction;
@@ -37,6 +39,7 @@
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.GpxExtension;
 import org.openstreetmap.josm.data.gpx.GpxLink;
+import org.openstreetmap.josm.data.gpx.IGpxLayerPrefs;
 import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
@@ -56,6 +59,7 @@
 import org.openstreetmap.josm.gui.preferences.display.GPXSettingsPanel;
 import org.openstreetmap.josm.io.audio.AudioPlayer;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Utils;
@@ -76,7 +80,7 @@
     /**
      * A list of markers.
      */
-    public final List<Marker> data;
+    public final MarkerData data;
     private boolean mousePressed;
     public GpxLayer fromLayer;
     private Marker currentMarker;
@@ -100,21 +104,20 @@
     public MarkerLayer(GpxData indata, String name, File associatedFile, GpxLayer fromLayer) {
         super(name);
         this.setAssociatedFile(associatedFile);
-        this.data = new ArrayList<>();
+        this.data = new MarkerData();
         this.fromLayer = fromLayer;
         double firstTime = -1.0;
         String lastLinkedFile = "";
 
-        Color c = null;
-        String cs = GPXSettingsPanel.tryGetLayerPrefLocal(indata, "markers.color");
+        String cs = GPXSettingsPanel.tryGetDataPrefLocal(indata, "markers.color");
         if (cs != null) {
-            try {
-                c = Color.decode(cs);
-            } catch (NumberFormatException ex) {
+            Color c = ColorHelper.html2color(cs);
+            if (c != null) {
+                setPrivateColors(c);
+            } else {
                 Logging.warn("Could not read marker color: " + cs);
             }
         }
-        setPrivateColors(c);
 
         for (WayPoint wpt : indata.waypoints) {
             /* calculate time differences in waypoints */
@@ -459,7 +462,7 @@
      * @return <code>true</code> if text should be shown, <code>false</code> otherwise.
      */
     private boolean isTextOrIconShown() {
-        return Boolean.parseBoolean(GPXSettingsPanel.getLayerPref(fromLayer, "markers.show-text"));
+        return Boolean.parseBoolean(GPXSettingsPanel.getDataPref(data, "markers.show-text"));
     }
 
     @Override
@@ -475,13 +478,11 @@
     @Override
     public void setColor(Color color) {
         setPrivateColors(color);
-        if (fromLayer != null) {
-            String cs = null;
-            if (color != null) {
-                cs = String.format("#%02X%02X%02X", color.getRed(), color.getGreen(), color.getBlue());
-            }
-            GPXSettingsPanel.putLayerPrefLocal(fromLayer, "markers.color", cs);
+        String cs = null;
+        if (color != null) {
+            cs = ColorHelper.color2html(color);
         }
+        GPXSettingsPanel.putDataPrefLocal(data, "markers.color", cs);
         invalidate();
     }
 
@@ -533,7 +534,7 @@
 
         @Override
         public void actionPerformed(ActionEvent e) {
-            GPXSettingsPanel.putLayerPrefLocal(layer.fromLayer, "markers.show-text", Boolean.toString(!layer.isTextOrIconShown()));
+            GPXSettingsPanel.putDataPrefLocal(layer.data, "markers.show-text", Boolean.toString(!layer.isTextOrIconShown()));
             layer.invalidate();
         }
 
@@ -617,4 +618,41 @@
             invalidate();
         }
     }
+
+    /**
+     * the data of a MarkerLayer
+     */
+    public class MarkerData extends ArrayList<Marker> implements IGpxLayerPrefs {
+
+        private Map<String, String> ownLayerPrefs;
+
+        @Override
+        public Map<String, String> getLayerPrefs() {
+            if (ownLayerPrefs == null && fromLayer != null && fromLayer.data != null) {
+                return fromLayer.data.getLayerPrefs();
+            }
+            // fallback to own layerPrefs if the corresponding gpxLayer has already been deleted
+            // by the user or never existed when loaded from a session file
+            if (ownLayerPrefs == null) {
+                ownLayerPrefs = new HashMap<>();
+            }
+            return ownLayerPrefs;
+        }
+
+        /**
+         * Transfers the layerPrefs from the GpxData to MarkerData (when GpxData is deleted)
+         * @param gpxLayerPrefs the layerPrefs from the GpxData object
+         */
+        public void transferLayerPrefs(Map<String, String> gpxLayerPrefs) {
+            ownLayerPrefs = new HashMap<>(gpxLayerPrefs);
+        }
+
+        @Override
+        public void setModified(boolean value) {
+            if (fromLayer != null && fromLayer.data != null) {
+                fromLayer.data.setModified(value);
+            }
+        }
+
+    }
 }
Index: src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java b/trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
--- a/trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(working copy)
@@ -29,6 +29,7 @@
 import org.apache.commons.jcs3.access.exception.InvalidArgumentException;
 import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.gpx.IGpxLayerPrefs;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.gpx.GpxDrawHelper;
@@ -172,6 +173,17 @@
      * @return the value
      */
     public static String getLayerPref(GpxLayer layer, String key) {
+        GpxData data = layer != null ? layer.data : null;
+        return getDataPref(data, key);
+    }
+
+    /**
+     * Reads the preference for the given layer or the default preference if not available
+     * @param data the data. Can be <code>null</code>, default preference will be returned then
+     * @param key the drawing key to be read, without "draw.rawgps."
+     * @return the value
+     */
+    public static String getDataPref(IGpxLayerPrefs data, String key) {
         Object d = DEFAULT_PREFS.get(key);
         String ds;
         if (d != null) {
@@ -180,7 +192,7 @@
             Logging.warn("No default value found for layer preference \"" + key + "\".");
             ds = null;
         }
-        return Optional.ofNullable(tryGetLayerPrefLocal(layer, key)).orElse(Config.getPref().get("draw.rawgps." + key, ds));
+        return Optional.ofNullable(tryGetDataPrefLocal(data, key)).orElse(Config.getPref().get("draw.rawgps." + key, ds));
     }
 
     /**
@@ -190,7 +202,18 @@
      * @return the integer value
      */
     public static int getLayerPrefInt(GpxLayer layer, String key) {
-        String s = getLayerPref(layer, key);
+        GpxData data = layer != null ? layer.data : null;
+        return getDataPrefInt(data, key);
+    }
+
+    /**
+     * Reads the integer preference for the given data or the default preference if not available
+     * @param data the data. Can be <code>null</code>, default preference will be returned then
+     * @param key the drawing key to be read, without "draw.rawgps."
+     * @return the integer value
+     */
+    public static int getDataPrefInt(IGpxLayerPrefs data, String key) {
+        String s = getDataPref(data, key);
         if (s != null) {
             try {
                 return Integer.parseInt(s);
@@ -213,7 +236,7 @@
      * @return the value or <code>null</code> if not found
      */
     public static String tryGetLayerPrefLocal(GpxLayer layer, String key) {
-        return layer != null ? tryGetLayerPrefLocal(layer.data, key) : null;
+        return layer != null ? tryGetDataPrefLocal(layer.data, key) : null;
     }
 
     /**
@@ -222,7 +245,7 @@
      * @param key the drawing key to be read, without "draw.rawgps."
      * @return the value or <code>null</code> if not found
      */
-    public static String tryGetLayerPrefLocal(GpxData data, String key) {
+    public static String tryGetDataPrefLocal(IGpxLayerPrefs data, String key) {
         return data != null ? data.getLayerPrefs().get(key) : null;
     }
 
@@ -236,7 +259,7 @@
         String v = value == null ? null : value.toString();
         if (layers != null) {
             for (GpxLayer l : layers) {
-                putLayerPrefLocal(l.data, key, v);
+                putDataPrefLocal(l.data, key, v);
             }
         } else {
             Config.getPref().put("draw.rawgps." + key, v);
@@ -251,7 +274,7 @@
      */
     public static void putLayerPrefLocal(GpxLayer layer, String key, String value) {
         if (layer == null) return;
-        putLayerPrefLocal(layer.data, key, value);
+        putDataPrefLocal(layer.data, key, value);
     }
 
     /**
@@ -260,7 +283,9 @@
      * @param key the drawing key to be written, without "draw.rawgps."
      * @param value the value or <code>null</code> to remove key
      */
-    public static void putLayerPrefLocal(GpxData data, String key, String value) {
+    public static void putDataPrefLocal(IGpxLayerPrefs data, String key, String value) {
+        if (data == null) return;
+        data.setModified(true);
         if (value == null || value.trim().isEmpty() ||
                 (getLayerPref(null, key).equals(value) && DEFAULT_PREFS.get(key) != null && DEFAULT_PREFS.get(key).toString().equals(value))) {
             data.getLayerPrefs().remove(key);
Index: src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java b/trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java
--- a/trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java	(working copy)
@@ -109,6 +109,11 @@
          */
         public void write(MarkerLayer layer) {
             GpxData data = new GpxData();
+            layer.data.getLayerPrefs().forEach((k, v) -> {
+                if (k != null && k.indexOf("markers.") == 0) {
+                    data.getLayerPrefs().put(k, v);
+                }
+            });
             data.put(GpxData.META_DESC, "exported JOSM marker layer");
             for (Marker m : layer.data) {
                 data.waypoints.add(m.convertToWayPoint());
Index: src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/io/session/SessionReader.java b/trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
--- a/trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(working copy)
@@ -3,7 +3,6 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.Color;
 import java.awt.GraphicsEnvironment;
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -46,7 +45,6 @@
 import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
-import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
@@ -619,15 +617,6 @@
                     Logging.warn(ex);
                 }
             }
-            String colorString = el.getAttribute("color");
-            if (colorString != null) {
-                try {
-                    Color color = ColorHelper.html2color(colorString);
-                    layer.setColor(color);
-                } catch (RuntimeException ex) {
-                    Logging.warn("Cannot parse color " + colorString);
-                }
-            }
             layer.setName(names.get(entry.getKey()));
             layers.add(layer);
         }
Index: src/org/openstreetmap/josm/io/session/SessionWriter.java
===================================================================
diff --git a/trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java b/trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
--- a/trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java	(revision 17921)
+++ b/trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java	(working copy)
@@ -43,7 +43,6 @@
 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
-import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
@@ -240,9 +239,6 @@
             if (!Utils.equalsEpsilon(layer.getOpacity(), 1.0)) {
                 el.setAttribute("opacity", Double.toString(layer.getOpacity()));
             }
-            if (layer.getColor() != null) {
-                el.setAttribute("color", ColorHelper.color2html(layer.getColor()));
-            }
             Set<Layer> deps = dependencies.get(layer);
             final String depends = deps == null ? "" : deps.stream().map(depLayer -> {
                 int depIndex = layers.indexOf(depLayer);
Index: test/data/sessions/gpx_markers.jos
===================================================================
diff --git a/trunk/test/data/sessions/gpx_markers.jos b/trunk/test/data/sessions/gpx_markers.jos
--- a/trunk/test/data/sessions/gpx_markers.jos	(revision 17921)
+++ b/trunk/test/data/sessions/gpx_markers.jos	(working copy)
@@ -15,7 +15,7 @@
         <layer index="1" name="GPX layer name" type="tracks" version="0.1" visible="true">
             <file>layers/01/data.gpx</file>
         </layer>
-        <layer color="#34567812" index="2" name="Marker layer name" opacity="0.5" type="markers" version="0.1" visible="true">
+        <layer index="2" name="Marker layer name" opacity="0.5" type="markers" version="0.1" visible="true">
             <file>layers/02/data.gpx</file>
         </layer>
     </layers>
Index: test/data/sessions/gpx_markers.joz
===================================================================
diff --git a/trunk/test/data/sessions/gpx_markers.joz b/trunk/test/data/sessions/gpx_markers.joz
GIT binary patch
literal 1636
zc$^FHW@Zs#;Nak3=q|eu#DD~ZfH)_yGPS5!-@s5mC9xz?FTJ2*Zji74V*`;r${*!*
z-Y;DKWAPSV7rz~Ey|gbVF$&$9ZC*J=XQS-Rwk7}Ta@(hgt#uIiIjQpVv$HnQbNW{~
zpHGO*F0p*va#rBQEt9oz(>LFq{r=|5H+!t?gkIO(xoDs+v-noimt)g@JYWCX`^)23
zd<Snxzc%EWbZhF5gTMDJD3M@$<ePsj?A~_emA#7^eJr2;_`%Vtf3bW2v6Zp@e-xLo
zzum+7!Ry-+Mk$*VgI^77;(FbB-$dQ6%kjwib!^PGO7FS6`*io~UyM`E+*+Vn%6mKP
zx|m+5o{w&A*Y|~mUlf(AR2OGoP-m{4CZGO5%T17LPtKC*S4DhG9=yuhC6p1cOGWjq
za>SLByb+GV4_p5nw|RL?@#-tTUqbrNROYXrmTsX~s4l78^R&C;L}CBtD8CbO>c>m8
ze`kGT<&5YFQ{fI5dv~zyIotZDx{O=4OMl^*E#$v0HX=V=$L;*4>L#Ij>qwpOpPKXE
zFKZ3^HE+j){5Kp`8;lLV$nEVcn~|;kB$`#!{&eKA3Jdcd(U*V3Os1-RRQMi$cgMBE
zbL(8gk6aJ<%N*d%&awE}Bf0sE3=9XD85jbHie4i`^oIE6&jCiS`>Fa3cMi|naQ1ke
zh-6XrQmsH`)v1f_#Z)MkFe=~Xe6xT3*=eyJx6dxSb8pYbJs)qh#eXerjdOSzWOnk9
zdQRhllPPg#uA6?8{XcnIXWgaK+;Lm}Hn!D1N}i%A;I@jT{%2Krv)z3=g%{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