pub struct ColorFg(/* private fields */);Implementations§
Source§impl ColorFg
impl ColorFg
pub fn black(self) -> AnsiBuilder
pub fn blue(self) -> AnsiBuilder
Sourcepub fn bright_blue(self) -> AnsiBuilder
pub fn bright_blue(self) -> AnsiBuilder
Examples found in repository?
examples/color.rs (line 12)
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}pub fn bright_cyan(self) -> AnsiBuilder
pub fn bright_green(self) -> AnsiBuilder
pub fn bright_magenta(self) -> AnsiBuilder
pub fn bright_red(self) -> AnsiBuilder
pub fn bright_white(self) -> AnsiBuilder
pub fn bright_yellow(self) -> AnsiBuilder
pub fn cyan(self) -> AnsiBuilder
pub fn gray(self) -> AnsiBuilder
pub fn green(self) -> AnsiBuilder
pub fn magenta(self) -> AnsiBuilder
Sourcepub fn red(self) -> AnsiBuilder
pub fn red(self) -> AnsiBuilder
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}pub fn white(self) -> AnsiBuilder
pub fn yellow(self) -> AnsiBuilder
pub fn rgb(self, r: u8, g: u8, b: u8) -> AnsiBuilder
Auto Trait Implementations§
impl Freeze for ColorFg
impl RefUnwindSafe for ColorFg
impl Send for ColorFg
impl Sync for ColorFg
impl Unpin for ColorFg
impl UnwindSafe for ColorFg
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