pub struct StyledText<'a> { /* private fields */ }Expand description
A comprehensive struct for styled text printing
Implementations§
Source§impl<'a> StyledText<'a>
impl<'a> StyledText<'a>
Sourcepub fn hex_color(self, hex: &str) -> Result<Self, String>
pub fn hex_color(self, hex: &str) -> Result<Self, String>
Set foreground color using hex string (e.g., “#FF0000” or “FF0000”)
Sourcepub fn bg_hex_color(self, hex: &str) -> Result<Self, String>
pub fn bg_hex_color(self, hex: &str) -> Result<Self, String>
Set background color using hex string
Sourcepub fn underline(self, style: UnderlineStyle) -> Self
pub fn underline(self, style: UnderlineStyle) -> Self
Set underline style
Sourcepub fn style(self, style: TextStyle) -> Self
pub fn style(self, style: TextStyle) -> Self
Add text style (can be chained for multiple styles)
Hide text
Sourcepub fn gradient(
text: &'a str,
start_color: (u8, u8, u8),
end_color: (u8, u8, u8),
) -> String
pub fn gradient( text: &'a str, start_color: (u8, u8, u8), end_color: (u8, u8, u8), ) -> String
Create a gradient effect across the text
Sourcepub fn polychrome(text: &'a str) -> String
pub fn polychrome(text: &'a str) -> String
Create polychrome text effect
Trait Implementations§
Source§impl<'a> Clone for StyledText<'a>
impl<'a> Clone for StyledText<'a>
Source§fn clone(&self) -> StyledText<'a>
fn clone(&self) -> StyledText<'a>
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<'a> Debug for StyledText<'a>
impl<'a> Debug for StyledText<'a>
Auto Trait Implementations§
impl<'a> Freeze for StyledText<'a>
impl<'a> RefUnwindSafe for StyledText<'a>
impl<'a> Send for StyledText<'a>
impl<'a> Sync for StyledText<'a>
impl<'a> Unpin for StyledText<'a>
impl<'a> UnwindSafe for StyledText<'a>
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