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

Function resolve_appearance

src/apps/cli/src/ui/theme.rs:137–145  ·  view source on GitHub ↗
(preference: &str)

Source from the content-addressed store, hash-verified

135}
136
137pub fn resolve_appearance(preference: &str) -> Appearance {
138 match preference.trim().to_ascii_lowercase().as_str() {
139 "light" => Appearance::Light,
140 "auto" => {
141 detect_terminal_appearance(Duration::from_millis(250)).unwrap_or(Appearance::Dark)
142 }
143 _ => Appearance::Dark,
144 }
145}
146
147fn detect_terminal_appearance(timeout: Duration) -> Option<Appearance> {
148 if std::env::var_os("NO_COLOR").is_some() {

Callers 5

newMethod · 0.85
current_base_themeMethod · 0.85
runMethod · 0.85
apply_theme_selectionMethod · 0.85

Calls 3

trimMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected