#[non_exhaustive]pub enum ColorMode {
Auto,
Truecolor,
Ansi256,
Ansi16,
Never,
}Expand description
Terminal colour capability override for the TUI theme system.
Auto runs OS-level detection at startup; any other value forces the specified mode
and skips detection entirely. Resolution is performed once at TUI startup and stored in
the TUI App theme.
§Example (TOML)
[tui.theme]
color_mode = "truecolor" # force 24-bit even if $COLORTERM is unset§Examples
use zeph_config::ColorMode;
let mode: ColorMode = toml::from_str("value = \"auto\"")
.map(|t: toml::Table| t["value"].clone().try_into().unwrap())
.unwrap();
assert_eq!(mode, ColorMode::Auto);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
Run terminal capability detection at startup (default).
Truecolor
Force 24-bit RGB output; skip capability detection.
Ansi256
Force RGB → xterm-256 downgrade.
Ansi16
Force RGB → ANSI-16 downgrade.
Never
Strip all colour; retain text modifiers only (equivalent to NO_COLOR).
Trait Implementations§
impl Copy for ColorMode
Source§impl<'de> Deserialize<'de> for ColorMode
impl<'de> Deserialize<'de> for ColorMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ColorMode
impl StructuralPartialEq for ColorMode
Auto Trait Implementations§
impl Freeze for ColorMode
impl RefUnwindSafe for ColorMode
impl Send for ColorMode
impl Sync for ColorMode
impl Unpin for ColorMode
impl UnsafeUnpin for ColorMode
impl UnwindSafe for ColorMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.