diff --git a/property-loader/src/main/java/com/github/weisj/darklaf/properties/parser/PrimitiveParser.java b/property-loader/src/main/java/com/github/weisj/darklaf/properties/parser/PrimitiveParser.java index f470ffa2..04d4efc4 100644 --- a/property-loader/src/main/java/com/github/weisj/darklaf/properties/parser/PrimitiveParser.java +++ b/property-loader/src/main/java/com/github/weisj/darklaf/properties/parser/PrimitiveParser.java @@ -37,13 +37,6 @@ public class PrimitiveParser implements PropertyParser { if (parseResult.value.startsWith(COLOR_PREFIX)) { Color c = ColorUtil.fromHex(parseResult.value, null, true); ParserUtil.setNonNull(parseResult, c != null ? new DarkColorUIResource(c) : null); - } else { - Color c = ColorUtil.fromHex(parseResult.value, null, true); - ParserUtil.setNonNull(parseResult, c != null ? new DarkColorUIResource(c) : null); - if (parseResult.finished) { - ParserUtil.warning("Declaration '" + parseResult.value + "' specifies a color " - + " without a '#' prefix, which is deprecated. Support will be dropped in future versions."); - } } if (parseResult.finished) return parseResult; if (ParserUtil.startsWith(parseResult, STRING_DELIMITER)) { diff --git a/property-loader/src/test/java/com/github/weisj/darklaf/properties/parser/ParserTest.java b/property-loader/src/test/java/com/github/weisj/darklaf/properties/parser/ParserTest.java index 21e5015a..25e72523 100644 --- a/property-loader/src/test/java/com/github/weisj/darklaf/properties/parser/ParserTest.java +++ b/property-loader/src/test/java/com/github/weisj/darklaf/properties/parser/ParserTest.java @@ -85,15 +85,6 @@ class ParserTest { } } - @Test - void testColorLegacy() { - Random r = new Random(); - for (int i = 0; i < 100; i++) { - Color c = new Color(r.nextInt(256), r.nextInt(256), r.nextInt(256)); - Assertions.assertEquals(c, parse("key", ColorUtil.toHex(c))); - } - } - @Test void testReferences() { Assertions.assertEquals("key", Parser.parse(new ParseResult("%key", "value"), context).key); @@ -126,10 +117,6 @@ class ParserTest { for (int i = 0; i < 100; i++) { int w = r.nextInt(); int h = r.nextInt(); - // While legacy declarations are supported these may be a valid color value. - // and parse incorrectly. - if (isValidColor(w)) continue; - if (isValidColor(h)) continue; Assertions.assertEquals(new Dimension(w, h), parse("test.size", w + "," + h)); Assertions.assertEquals(new Dimension(w, h), parse("testSize", w + "," + h)); } @@ -139,22 +126,11 @@ class ParserTest { Assertions.assertEquals(dim, parse("key.size", "%key.width," + dim.height)); } - private boolean isValidColor(final int value) { - return ColorUtil.fromHex(String.valueOf(value), null) != null; - } - @Test void testInsets() { Random r = new Random(); for (int i = 0; i < 100; i++) { Insets insets = new Insets(r.nextInt(), r.nextInt(), r.nextInt(), r.nextInt()); - - // While legacy declarations are supported these may be a valid color value - // hence parse incorrectly. - if (isValidColor(insets.left)) continue; - if (isValidColor(insets.right)) continue; - if (isValidColor(insets.bottom)) continue; - if (isValidColor(insets.top)) continue; Assertions.assertEquals(insets, parse("test.insets", insets.top + "," + insets.left + "," + insets.bottom + "," + insets.right)); Assertions.assertEquals(insets, parse("testInsets",