Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 7237)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 7238)
@@ -23,5 +23,5 @@
     protected Map<String, Object> prop = new HashMap<>();
 
-    private static final Pattern HEX_COLOR_PATTERN = Pattern.compile("#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})");
+    private static final Pattern HEX_COLOR_PATTERN = Pattern.compile("#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})");
 
     public <T> T get(String key, T def, Class<T> klass) {
@@ -106,4 +106,12 @@
             if (o instanceof Keyword)
                 return (T) ((Keyword) o).val;
+            if (o instanceof Color) {
+                Color c = (Color) o;
+                int alpha = c.getAlpha();
+                if (alpha != 255)
+                    return (T) String.format("#%06x%02x", ((Color) o).getRGB() & 0x00ffffff, alpha);
+                return (T) String.format("#%06x", ((Color) o).getRGB() & 0x00ffffff);
+                
+            }
 
             return (T) o.toString();
@@ -129,11 +137,19 @@
         if (o instanceof Boolean)
             return (Boolean) o;
+        String s = null;
         if (o instanceof Keyword) {
-            String s = ((Keyword) o).val;
-            if ("true".equals(s) || "yes".equals(s))
-                return true;
-            if ("false".equals(s) || "no".equals(s))
-                return false;
-        }
+            s = ((Keyword) o).val;
+        } else if (o instanceof String) {
+            s = (String) o;
+        }
+        if (s != null)
+            return !(s.isEmpty() || "false".equals(s) || "no".equals(s) || "0".equals(s) || "0.0".equals(s));
+        if (o instanceof Number)
+            return ((Number) o).floatValue() == 0.0f;
+        if (o instanceof List)
+            return !((List) o).isEmpty();
+        if (o instanceof float[])
+            return ((float[]) o).length != 0;
+        
         return null;
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7237)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7238)
@@ -467,14 +467,4 @@
 
         /**
-         * Obtains the JOSM'key {@link org.openstreetmap.josm.data.Preferences} color for key {@code key},
-         * and defaults to {@code def} if that is null.
-         * @see org.openstreetmap.josm.data.Preferences#getColor(String, java.awt.Color)
-         */
-        public static Color JOSM_pref_color(String key, Color def) {
-            Color res = Main.pref.getColor(key, null);
-            return res != null ? res : def;
-        }
-
-        /**
          * Tests if string {@code target} matches pattern {@code pattern}
          * @see Pattern#matches(String, CharSequence)
@@ -642,4 +632,5 @@
          * @return the same object, unchanged
          */
+        @NullableArguments
         public static Object print(Object o) {
             System.out.print(o == null ? "none" : o.toString());
@@ -653,4 +644,5 @@
          * @return the same object, unchanged
          */
+        @NullableArguments
         public static Object println(Object o) {
             System.out.println(o == null ? "none" : o.toString());
