@Override
	public ParseResult parse( RSyntaxDocument doc, String style ) {
		Element root = doc.getDefaultRootElement();

		result.clearNotices();
		result.setParsedLines( 0, root.getElementCount() - 1 );

		for( Token token : doc ) {
			if( token.getType() == FlatThemeTokenMaker.TOKEN_COLOR ) {
				try {
					UIDefaultsLoaderAccessor.parseColorRGBA( token.getLexeme() );
				} catch( IllegalArgumentException ex ) {
					result.addNotice( new DefaultParserNotice( this,
						"Invalid color.\n\nUse #RRGGBB, #RRGGBBAA, #RGB or #RGBA",
						root.getElementIndex( token.getOffset() ),
						token.getOffset(), token.length() ) );
				}
			}
		}

		return result;
	}
Parser for FlatLaf properties files that checks for invalid values.

@author Karl Tauber
flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeParser.java