(s: &str)
| 27 | type Err = String; |
| 28 | |
| 29 | fn from_str(s: &str) -> Result<Self, Self::Err> { |
| 30 | match s.to_lowercase().as_str() { |
| 31 | "auto" => Ok(Self::Auto), |
| 32 | "dark" => Ok(Self::Dark), |
| 33 | "light" => Ok(Self::Light), |
| 34 | other => Err(format!( |
| 35 | "unknown theme mode: {other} (expected auto, dark, or light)" |
| 36 | )), |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /// Complete color theme for the TUI. |