(
&self,
base: Theme,
appearance: Appearance,
scheme: EffectiveColorScheme,
id: &str,
)
| 1672 | } |
| 1673 | |
| 1674 | fn resolve_theme_by_id( |
| 1675 | &self, |
| 1676 | base: Theme, |
| 1677 | appearance: Appearance, |
| 1678 | scheme: EffectiveColorScheme, |
| 1679 | id: &str, |
| 1680 | ) -> Theme { |
| 1681 | if scheme == EffectiveColorScheme::Monochrome { |
| 1682 | return Theme::monochrome(); |
| 1683 | } |
| 1684 | |
| 1685 | let id = id.trim(); |
| 1686 | if id.is_empty() { |
| 1687 | return base; |
| 1688 | } |
| 1689 | |
| 1690 | if let Some(json) = builtin_theme_json(id) { |
| 1691 | return base |
| 1692 | .apply_opencode_theme_json(json, appearance) |
| 1693 | .unwrap_or(base) |
| 1694 | .with_effective_scheme(scheme); |
| 1695 | } |
| 1696 | |
| 1697 | base |
| 1698 | } |
| 1699 | |
| 1700 | fn begin_theme_preview(&mut self) { |
| 1701 | if self.theme_preview_original.is_none() { |
no test coverage detected