MCPcopy Create free account
hub / github.com/GCWing/BitFun / resolve_theme_by_id

Method resolve_theme_by_id

src/apps/cli/src/modes/chat.rs:1890–1913  ·  view source on GitHub ↗
(
        &self,
        base: Theme,
        appearance: Appearance,
        scheme: EffectiveColorScheme,
        id: &str,
    )

Source from the content-addressed store, hash-verified

1888 }
1889
1890 fn resolve_theme_by_id(
1891 &self,
1892 base: Theme,
1893 appearance: Appearance,
1894 scheme: EffectiveColorScheme,
1895 id: &str,
1896 ) -> Theme {
1897 if scheme == EffectiveColorScheme::Monochrome {
1898 return Theme::monochrome();
1899 }
1900
1901 if id.is_empty() {
1902 return base;
1903 }
1904
1905 if let Some(json) = builtin_theme_json(id) {
1906 return base
1907 .apply_opencode_theme_json(json, appearance)
1908 .unwrap_or(base)
1909 .with_effective_scheme(scheme);
1910 }
1911
1912 base
1913 }
1914
1915 fn preview_theme_selection(&mut self, theme: &ThemeItem, chat_view: &mut ChatView) {
1916 let appearance = resolve_appearance(&self.config.ui.theme);

Callers 3

apply_theme_selectionMethod · 0.45

Calls 4

builtin_theme_jsonFunction · 0.85
with_effective_schemeMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected