pub struct Color(pub AnsiBuilder);Tuple Fields§
§0: AnsiBuilderImplementations§
Source§impl Color
impl Color
Sourcepub fn fg(self) -> ColorFg
pub fn fg(self) -> ColorFg
Examples found in repository?
examples/color.rs (line 9)
1fn main() {
2 #[cfg(windows)]
3 if !ansi_builder::enable_ansi_color() {
4 println!("Failed to enable_ansi_color.");
5 }
6
7 AnsiBuilder::new()
8 .text("Hello, World! ")
9 .color().fg().red()
10 .text("Hello, World but in red!")
11 .println()
12 .color().fg().bright_blue()
13 .color().bg().red()
14 .text("Another sample text")
15 .reset_attributes()
16 .text(" Everything is reverted")
17 .println();
18}Sourcepub fn bg(self) -> ColorBg
pub fn bg(self) -> ColorBg
Examples found in repository?
examples/color.rs (line 13)
1fn main() {
2 #[cfg(windows)]
3 if !ansi_builder::enable_ansi_color() {
4 println!("Failed to enable_ansi_color.");
5 }
6
7 AnsiBuilder::new()
8 .text("Hello, World! ")
9 .color().fg().red()
10 .text("Hello, World but in red!")
11 .println()
12 .color().fg().bright_blue()
13 .color().bg().red()
14 .text("Another sample text")
15 .reset_attributes()
16 .text(" Everything is reverted")
17 .println();
18}Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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