pub struct ResolvedTheme {
pub name: Cow<'static, str>,
/* private fields */
}Expand description
Fields§
§name: Cow<'static, str>Theme display name.
Implementations§
Source§impl ResolvedTheme
impl ResolvedTheme
Sourcepub fn from_slots(
fg: impl IntoIterator<Item = (ThemeColor, Rgb)>,
bg: impl IntoIterator<Item = (ThemeBg, Rgb)>,
mode: ColorMode,
name: impl Into<Cow<'static, str>>,
) -> Self
pub fn from_slots( fg: impl IntoIterator<Item = (ThemeColor, Rgb)>, bg: impl IntoIterator<Item = (ThemeBg, Rgb)>, mode: ColorMode, name: impl Into<Cow<'static, str>>, ) -> Self
Build from resolved per-slot colors.
Sourcepub fn fg_rgb(&self, color: ThemeColor) -> Rgb
pub fn fg_rgb(&self, color: ThemeColor) -> Rgb
Raw RGB for a foreground slot (empty slots return black; check Self::is_fg_empty).
Sourcepub fn is_fg_empty(&self, color: ThemeColor) -> bool
pub fn is_fg_empty(&self, color: ThemeColor) -> bool
Whether a foreground slot is empty (resets color).
Sourcepub fn is_bg_empty(&self, bg: ThemeBg) -> bool
pub fn is_bg_empty(&self, bg: ThemeBg) -> bool
Whether a background slot is empty.
Sourcepub fn fg(&self, color: ThemeColor, text: &str) -> String
pub fn fg(&self, color: ThemeColor, text: &str) -> String
Style text with a foreground color, resetting foreground after.
Mirrors reference Theme.fg: \x1b[38..m{text}\x1b[39m.
Sourcepub fn bg(&self, bg: ThemeBg, text: &str) -> String
pub fn bg(&self, bg: ThemeBg, text: &str) -> String
Style text with a background color, resetting background after.
Sourcepub fn bg_ansi(&self, bg: ThemeBg) -> String
pub fn bg_ansi(&self, bg: ThemeBg) -> String
Return the background ANSI prefix string for bg (no trailing reset).
Used to build the Fn(&str) -> String background applicators that
pi-tui’s Padded/Text containers accept.
Sourcepub fn fg_ansi(&self, color: ThemeColor) -> String
pub fn fg_ansi(&self, color: ThemeColor) -> String
Return the foreground ANSI prefix string for color (no trailing reset).
Trait Implementations§
Source§impl Clone for ResolvedTheme
impl Clone for ResolvedTheme
Source§fn clone(&self) -> ResolvedTheme
fn clone(&self) -> ResolvedTheme
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResolvedTheme
impl RefUnwindSafe for ResolvedTheme
impl Send for ResolvedTheme
impl Sync for ResolvedTheme
impl Unpin for ResolvedTheme
impl UnsafeUnpin for ResolvedTheme
impl UnwindSafe for ResolvedTheme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.