use serde::Deserialize;
#[derive(Debug, Default, Deserialize)]
#[serde(default, deny_unknown_fields)]
pub(super) struct RawLegacyTheme {
pub(super) accent_color: Option<String>,
pub(super) function_color: Option<String>,
pub(super) constant_color: Option<String>,
pub(super) operator_color: Option<String>,
pub(super) number_color: Option<String>,
pub(super) variable_color: Option<String>,
pub(super) ans_color: Option<String>,
pub(super) comment_color: Option<String>,
pub(super) unit_color: Option<String>,
pub(super) settings_bar_bg: Option<String>,
#[allow(dead_code, reason = "accepted for compatibility, without effect")]
pub(super) history_alt_bg: Option<String>,
pub(super) history_separator_color: Option<String>,
}
pub(super) fn chrome_colors(
legacy: &RawLegacyTheme,
) -> impl Iterator<Item = (&'static str, String)> + '_ {
[
("accent", &legacy.accent_color),
("footer", &legacy.settings_bar_bg),
("border", &legacy.history_separator_color),
]
.into_iter()
.filter_map(|(name, value)| Some((name, value.clone()?)))
}