Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/ColorProperty.java
r10824 r10922 21 21 */ 22 22 public ColorProperty(String colName, String defaultValue) { 23 this(colName, ColorHelper.html2color(defaultValue)); 23 this(colName, defaultValue == null ? null : ColorHelper.html2color(defaultValue)); 24 24 } 25 25 -
trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.groovy
r10853 r10922 21 21 assert new ColorProperty("foo", new Color(0x12345678, true)).get().alpha == 0x12 22 22 assert Main.pref.putColor("bar", new Color(0x12345678, true)) 23 assert new ColorProperty("bar", null).get().alpha == 0x12 23 assert new ColorProperty("bar", (String) null).get().alpha == 0x12 24 24 } 25 25 26 26 void testColorNameAlpha() { 27 assert new ColorProperty("foo", "bar",new Color(0x12345678, true)).get().alpha == 0x1227 assert new ColorProperty("foo", new Color(0x12345678, true)).get().alpha == 0x12 28 28 assert Main.pref.getDefaultColor("foo") == new Color(0x34, 0x56, 0x78, 0x12) 29 29 assert Main.pref.getDefaultColor("foo").alpha == 0x12
Note:
See TracChangeset
for help on using the changeset viewer.