protected Color getForeground( JComponent c ) {
		Color fg = c.getForeground();
		boolean def = isDefaultButton( c );
		boolean toolBarButton = !def && (isToolBarButton( c ) || isBorderlessButton( c ));

		// selected state
		if( ((AbstractButton)c).isSelected() ) {
			return buttonStateColor( c,
				toolBarButton
					? (toolbarSelectedForeground != null ? toolbarSelectedForeground : fg)
					: (isCustomForeground( fg ) ? fg : selectedForeground),
				toolBarButton
					? (toolbarDisabledSelectedForeground != null ? toolbarDisabledSelectedForeground : disabledText)
					: (disabledSelectedForeground != null ? disabledSelectedForeground : disabledText),
				null,
				null,
				toolBarButton ? toolbarPressedForeground : pressedForeground );
		}

		// toolbar button
		if( toolBarButton ) {
			return buttonStateColor( c,
				fg,
				disabledText,
				null,
				toolbarHoverForeground,
				toolbarPressedForeground );
		}

		return buttonStateColor( c,
			getForegroundBase( c, def ),
			disabledText,
			isCustomForeground( fg ) ? null : (def ? defaultFocusedForeground : focusedForeground),
			def ? defaultHoverForeground : hoverForeground,
			def ? defaultPressedForeground : pressedForeground );
	}
Similar to BasicButtonUI.paint(), but does not use zero insets for HTML text,
which is done in BasicButtonUI.layout() since Java 19.
See https://github.com/openjdk/jdk/pull/8407
and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java