private int colorLuminance( Color c ) {
		int red = c.getRed();
		int green = c.getGreen();
		int blue = c.getBlue();

		int min = Math.min( red, Math.min( green, blue ) );
		int max = Math.max( red, Math.max( green, blue ) );

		return (max + min) / 2;
	}
A text area that supports editing FlatLaf themes.

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