private static boolean saveCurrentValues(ThemeManager themeManager, String themeName) {
		GTheme activeTheme = themeManager.getActiveTheme();
		File file = getSaveFile(themeName);
		if (!file.exists()) {
			Msg.info(ThemeUtils.class, "Saving theme to " + file);
		}
		LafType lafType = activeTheme.getLookAndFeelType();
		boolean useDarkDefaults = activeTheme.useDarkDefaults();

		LafType currentLafType = themeManager.getLookAndFeelType();

		// if the user has change the lookAndFeel from the current active theme, then
		// save it as the lookAndFeel for the newly saved theme
		if (currentLafType != activeTheme.getLookAndFeelType()) {
			lafType = currentLafType;
			useDarkDefaults = lafType.usesDarkDefaults();
		}

		GTheme newTheme = new GTheme(file, themeName, lafType, useDarkDefaults);
		newTheme.load(themeManager.getNonDefaultValues());
		try {
			newTheme.save();
			themeManager.addTheme(newTheme);
			themeManager.setTheme(newTheme);
		}
		catch (IOException e) {
			Msg.showError(ThemeUtils.class, null, "I/O Error",
				"Error writing theme file: " + newTheme.getFile().getAbsolutePath(), e);
			return false;
		}
		return true;
	}
Prompts for and deletes a selected theme.
@param themeManager the theme manager
Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeUtils.java