Index: trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 16252)
@@ -26,5 +26,5 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
 import org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable;
-import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.ColorHelper;
 
 /**
@@ -83,5 +83,5 @@
             if (mousePos == null || mousePosStart == null || mousePos == mousePosStart)
                 return;
-            Color color = Utils.complement(PaintColors.getBackgroundColor());
+            Color color = ColorHelper.complement(PaintColors.getBackgroundColor());
             g.setColor(color);
             if (lassoMode) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 16252)
@@ -75,4 +75,5 @@
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.gui.widgets.ScrollableTable;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageOverlay;
@@ -612,5 +613,5 @@
             }
             if (s.getBackgroundColorOverride() != null) {
-                text.append(tableRow(tr("Background:"), Utils.toString(s.getBackgroundColorOverride())));
+                text.append(tableRow(tr("Background:"), ColorHelper.color2html(s.getBackgroundColorOverride())));
             }
             text.append(tableRow(tr("Style is currently active?"), s.active ? tr("Yes") : tr("No")))
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 16252)
@@ -15,5 +15,4 @@
 import org.openstreetmap.josm.tools.GenericParser;
 import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -251,5 +250,5 @@
                 sb.append(Arrays.toString((float[]) val));
             } else if (val instanceof Color) {
-                sb.append(Utils.toString((Color) val));
+                sb.append(ColorHelper.color2html((Color) val));
             } else if (val != null) {
                 sb.append(val);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java	(revision 16252)
@@ -271,5 +271,5 @@
      */
     public static float red(Color c) { // NO_UCD (unused code)
-        return Utils.colorInt2float(c.getRed());
+        return ColorHelper.int2float(c.getRed());
     }
 
@@ -281,5 +281,5 @@
      */
     public static float green(Color c) { // NO_UCD (unused code)
-        return Utils.colorInt2float(c.getGreen());
+        return ColorHelper.int2float(c.getGreen());
     }
 
@@ -291,5 +291,5 @@
      */
     public static float blue(Color c) { // NO_UCD (unused code)
-        return Utils.colorInt2float(c.getBlue());
+        return ColorHelper.int2float(c.getBlue());
     }
 
@@ -301,5 +301,5 @@
      */
     public static float alpha(Color c) { // NO_UCD (unused code)
-        return Utils.colorInt2float(c.getAlpha());
+        return ColorHelper.int2float(c.getAlpha());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java	(revision 16252)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.HiDPISupport;
 import org.openstreetmap.josm.tools.Utils;
@@ -96,5 +97,5 @@
 
             fillImage.alpha = Utils.clamp(Config.getPref().getInt("mappaint.fill-image-alpha", 255), 0, 255);
-            Integer pAlpha = Utils.colorFloat2int(c.get(FILL_OPACITY, null, float.class));
+            Integer pAlpha = ColorHelper.float2int(c.get(FILL_OPACITY, null, float.class));
             if (pAlpha != null) {
                 fillImage.alpha = pAlpha;
@@ -103,7 +104,7 @@
             color = c.get(FILL_COLOR, null, Color.class);
             if (color != null) {
-                float defaultOpacity = Utils.colorInt2float(DEFAULT_FILL_ALPHA.get());
+                float defaultOpacity = ColorHelper.int2float(DEFAULT_FILL_ALPHA.get());
                 float opacity = c.get(FILL_OPACITY, defaultOpacity, Float.class);
-                color = Utils.alphaMultiply(color, opacity);
+                color = ColorHelper.alphaMultiply(color, opacity);
             }
         }
@@ -159,5 +160,5 @@
     @Override
     public String toString() {
-        return "AreaElemStyle{" + super.toString() + "color=" + Utils.toString(color) +
+        return "AreaElemStyle{" + super.toString() + "color=" + ColorHelper.color2html(color) +
                 " fillImage=[" + fillImage + "] extent=[" + extent + "] extentThreshold=[" + extentThreshold + "]}";
     }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java	(revision 16252)
@@ -20,6 +20,6 @@
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.RelativeFloat;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -235,8 +235,8 @@
     public String toString() {
         return "LineElemStyle{" + super.toString() + "width=" + line.getLineWidth() +
-            " realWidth=" + realWidth + " color=" + Utils.toString(color) +
+            " realWidth=" + realWidth + " color=" + ColorHelper.color2html(color) +
             " dashed=" + Arrays.toString(line.getDashArray()) +
             (line.getDashPhase() == 0 ? "" : " dashesOffses=" + line.getDashPhase()) +
-            " dashedColor=" + Utils.toString(dashesBackground) +
+            " dashedColor=" + ColorHelper.color2html(dashesBackground) +
             " linejoin=" + linejoinToString(line.getLineJoin()) +
             " linecap=" + linecapToString(line.getEndCap()) +
@@ -334,5 +334,5 @@
         }
 
-        Integer pAlpha = Utils.colorFloat2int(c.get(type.prefix + OPACITY, null, Float.class));
+        Integer pAlpha = ColorHelper.float2int(c.get(type.prefix + OPACITY, null, Float.class));
         if (pAlpha != null) {
             alpha = pAlpha;
@@ -363,5 +363,5 @@
         Color dashesBackground = c.get(type.prefix + DASHES_BACKGROUND_COLOR, null, Color.class);
         if (dashesBackground != null) {
-            pAlpha = Utils.colorFloat2int(c.get(type.prefix + DASHES_BACKGROUND_OPACITY, null, Float.class));
+            pAlpha = ColorHelper.float2int(c.get(type.prefix + DASHES_BACKGROUND_OPACITY, null, Float.class));
             if (pAlpha != null) {
                 alpha = pAlpha;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 16252)
@@ -23,8 +23,8 @@
 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.BoxProviderResult;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.ImageResource;
 import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -240,5 +240,5 @@
      */
     public float getAlphaFloat() {
-        return Utils.colorInt2float(alpha);
+        return ColorHelper.int2float(alpha);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 16252)
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.RotationAngle;
@@ -168,5 +169,5 @@
 
         mapImage.alpha = Utils.clamp(Config.getPref().getInt("mappaint.icon-image-alpha", 255), 0, 255);
-        Integer pAlpha = Utils.colorFloat2int(c.get(keys[ICON_OPACITY_IDX], null, float.class));
+        Integer pAlpha = ColorHelper.float2int(c.get(keys[ICON_OPACITY_IDX], null, float.class));
         if (pAlpha != null) {
             mapImage.alpha = pAlpha;
@@ -213,5 +214,5 @@
         Stroke stroke = null;
         if (strokeColor != null && strokeWidth != null) {
-            Integer strokeAlpha = Utils.colorFloat2int(c.get("symbol-stroke-opacity", null, Float.class));
+            Integer strokeAlpha = ColorHelper.float2int(c.get("symbol-stroke-opacity", null, Float.class));
             if (strokeAlpha != null) {
                 strokeColor = new Color(strokeColor.getRed(), strokeColor.getGreen(),
@@ -227,5 +228,5 @@
 
         if (fillColor != null) {
-            Integer fillAlpha = Utils.colorFloat2int(c.get("symbol-fill-opacity", null, Float.class));
+            Integer fillAlpha = ColorHelper.float2int(c.get("symbol-fill-opacity", null, Float.class));
             if (fillAlpha != null) {
                 fillColor = new Color(fillColor.getRed(), fillColor.getGreen(),
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java	(revision 16252)
@@ -18,5 +18,5 @@
 import org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.TagLookupCompositionStrategy;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
-import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.ColorHelper;
 
 /**
@@ -140,5 +140,5 @@
         Color color = c.get(TEXT_COLOR, defaultTextColor, Color.class);
         float alpha = c.get(TEXT_OPACITY, 1f, Float.class);
-        color = Utils.alphaMultiply(color, alpha);
+        color = ColorHelper.alphaMultiply(color, alpha);
 
         Float haloRadius = c.get(TEXT_HALO_RADIUS, null, Float.class);
@@ -148,7 +148,7 @@
         Color haloColor = null;
         if (haloRadius != null) {
-            haloColor = c.get(TEXT_HALO_COLOR, Utils.complement(color), Color.class);
+            haloColor = c.get(TEXT_HALO_COLOR, ColorHelper.complement(color), Color.class);
             float haloAlphaFactor = c.get(TEXT_HALO_OPACITY, 1f, Float.class);
-            haloColor = Utils.alphaMultiply(haloColor, haloAlphaFactor);
+            haloColor = ColorHelper.alphaMultiply(haloColor, haloAlphaFactor);
         }
 
@@ -199,5 +199,5 @@
         sb.append("labelCompositionStrategy=").append(labelCompositionStrategy)
           .append(" font=").append(font)
-          .append(" color=").append(Utils.toString(color));
+          .append(" color=").append(ColorHelper.color2html(color));
         if (haloRadius != null) {
             sb.append(" haloRadius=").append(haloRadius)
Index: trunk/src/org/openstreetmap/josm/tools/ColorHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ColorHelper.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/tools/ColorHelper.java	(revision 16252)
@@ -3,5 +3,4 @@
 
 import java.awt.Color;
-import java.util.Locale;
 
 /**
@@ -39,9 +38,4 @@
     }
 
-    private static String int2hex(int i) {
-        String s = Integer.toHexString(i / 16) + Integer.toHexString(i % 16);
-        return s.toUpperCase(Locale.ENGLISH);
-    }
-
     /**
      * Returns the HTML color code (6 or 8 digit).
@@ -55,20 +49,16 @@
     /**
      * Returns the HTML color code (6 or 8 digit).
-     * @param col The color to convert
+     * @param color The color to convert
      * @param withAlpha if {@code true} and alpha value &lt; 255, return 8-digit color code, else always 6-digit
      * @return the HTML color code (6 or 8 digit)
      * @since 6655
      */
-    public static String color2html(Color col, boolean withAlpha) {
-        if (col == null)
+    public static String color2html(Color color, boolean withAlpha) {
+        if (color == null)
             return null;
-        String code = '#'+int2hex(col.getRed())+int2hex(col.getGreen())+int2hex(col.getBlue());
-        if (withAlpha) {
-            int alpha = col.getAlpha();
-            if (alpha < 255) {
-                code += int2hex(alpha);
-            }
-        }
-        return code;
+        int alpha = color.getAlpha();
+        return withAlpha && alpha != 255
+                ? String.format("#%06X%02X", color.getRGB() & 0x00ffffff, alpha)
+                : String.format("#%06X", color.getRGB() & 0x00ffffff);
     }
 
@@ -86,3 +76,54 @@
                   Color.BLACK : Color.WHITE;
     }
+
+    /**
+     * convert float range 0 &lt;= x &lt;= 1 to integer range 0..255
+     * when dealing with colors and color alpha value
+     * @param val float value between 0 and 1
+     * @return null if val is null, the corresponding int if val is in the
+     *         range 0...1. If val is outside that range, return 255
+     */
+    public static Integer float2int(Float val) {
+        if (val == null)
+            return null;
+        if (val < 0 || val > 1)
+            return 255;
+        return (int) (255f * val + 0.5f);
+    }
+
+    /**
+     * convert integer range 0..255 to float range 0 &lt;= x &lt;= 1
+     * when dealing with colors and color alpha value
+     * @param val integer value
+     * @return corresponding float value in range 0 &lt;= x &lt;= 1
+     */
+    public static Float int2float(Integer val) {
+        if (val == null)
+            return null;
+        if (val < 0 || val > 255)
+            return 1f;
+        return ((float) val) / 255f;
+    }
+
+    /**
+     * Multiply the alpha value of the given color with the factor. The alpha value is clamped to 0..255
+     * @param color The color
+     * @param alphaFactor The factor to multiply alpha with.
+     * @return The new color.
+     * @since 11692
+     */
+    public static Color alphaMultiply(Color color, float alphaFactor) {
+        int alpha = float2int(int2float(color.getAlpha()) * alphaFactor);
+        alpha = Utils.clamp(alpha, 0, 255);
+        return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
+    }
+
+    /**
+     * Returns the complementary color of {@code clr}.
+     * @param clr the color to complement
+     * @return the complementary color of {@code clr}
+     */
+    public static Color complement(Color clr) {
+        return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());
+    }
 }
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 16248)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 16252)
@@ -6,5 +6,4 @@
 import static org.openstreetmap.josm.tools.I18n.trn;
 
-import java.awt.Color;
 import java.awt.Font;
 import java.awt.font.FontRenderContext;
@@ -258,70 +257,4 @@
 
     /**
-     * convert Color to String
-     * (Color.toString() omits alpha value)
-     * @param c the color
-     * @return the String representation, including alpha
-     */
-    public static String toString(Color c) {
-        if (c == null)
-            return "null";
-        if (c.getAlpha() == 255)
-            return String.format("#%06x", c.getRGB() & 0x00ffffff);
-        else
-            return String.format("#%06x(alpha=%d)", c.getRGB() & 0x00ffffff, c.getAlpha());
-    }
-
-    /**
-     * convert float range 0 &lt;= x &lt;= 1 to integer range 0..255
-     * when dealing with colors and color alpha value
-     * @param val float value between 0 and 1
-     * @return null if val is null, the corresponding int if val is in the
-     *         range 0...1. If val is outside that range, return 255
-     */
-    public static Integer colorFloat2int(Float val) {
-        if (val == null)
-            return null;
-        if (val < 0 || val > 1)
-            return 255;
-        return (int) (255f * val + 0.5f);
-    }
-
-    /**
-     * convert integer range 0..255 to float range 0 &lt;= x &lt;= 1
-     * when dealing with colors and color alpha value
-     * @param val integer value
-     * @return corresponding float value in range 0 &lt;= x &lt;= 1
-     */
-    public static Float colorInt2float(Integer val) {
-        if (val == null)
-            return null;
-        if (val < 0 || val > 255)
-            return 1f;
-        return ((float) val) / 255f;
-    }
-
-    /**
-     * Multiply the alpha value of the given color with the factor. The alpha value is clamped to 0..255
-     * @param color The color
-     * @param alphaFactor The factor to multiply alpha with.
-     * @return The new color.
-     * @since 11692
-     */
-    public static Color alphaMultiply(Color color, float alphaFactor) {
-        int alpha = Utils.colorFloat2int(Utils.colorInt2float(color.getAlpha()) * alphaFactor);
-        alpha = clamp(alpha, 0, 255);
-        return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
-    }
-
-    /**
-     * Returns the complementary color of {@code clr}.
-     * @param clr the color to complement
-     * @return the complementary color of {@code clr}
-     */
-    public static Color complement(Color clr) {
-        return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());
-    }
-
-    /**
      * Copies the given array. Unlike {@link Arrays#copyOf}, this method is null-safe.
      * @param <T> type of items
