pub enum ThemeVariant {
Dark,
Light,
Auto,
}Expand description
Theme variant selection enum.
The ThemeVariant enum allows users to explicitly select dark or light
theme, or let the system auto-detect based on terminal settings.
Theme variant selection.
Controls which color scheme to use for rendering. The Auto variant
will attempt to detect the terminal’s color scheme, falling back to
dark mode if detection is not available.
§Variants
Dark- Use dark mode colors (light text on dark background)Light- Use light mode colors (dark text on light background)Auto- Detect from terminal settings (requirestermenvfeature)
§Example
ⓘ
use ratatui_toolkit::markdown_widget::extensions::theme::{ThemeVariant, get_effective_theme_variant};
// Explicitly use dark mode
let variant = ThemeVariant::Dark;
// Auto-detect (falls back to dark if detection unavailable)
let auto_variant = ThemeVariant::Auto;
let effective = get_effective_theme_variant(auto_variant);Variants§
Dark
Use dark mode colors (light text on dark background).
Light
Use light mode colors (dark text on light background).
Auto
Detect from terminal settings.
When the termenv feature is enabled, this will attempt to detect
the terminal’s color scheme. Without the feature, defaults to Dark.
Trait Implementations§
Source§impl Clone for ThemeVariant
impl Clone for ThemeVariant
Source§fn clone(&self) -> ThemeVariant
fn clone(&self) -> ThemeVariant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThemeVariant
impl Debug for ThemeVariant
Source§impl Default for ThemeVariant
impl Default for ThemeVariant
Source§fn default() -> ThemeVariant
fn default() -> ThemeVariant
Returns the “default value” for a type. Read more
Source§impl PartialEq for ThemeVariant
impl PartialEq for ThemeVariant
impl Copy for ThemeVariant
impl Eq for ThemeVariant
impl StructuralPartialEq for ThemeVariant
Auto Trait Implementations§
impl Freeze for ThemeVariant
impl RefUnwindSafe for ThemeVariant
impl Send for ThemeVariant
impl Sync for ThemeVariant
impl Unpin for ThemeVariant
impl UnsafeUnpin for ThemeVariant
impl UnwindSafe for ThemeVariant
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,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more