pub struct OutputFormatter { /* private fields */ }
Implementations§
Source§impl OutputFormatter
This struct is used to create the builder for CLI-colors
the following example creates a string “hi”, that has white (as hex-color) foreground and green background
impl OutputFormatter
This struct is used to create the builder for CLI-colors the following example creates a string “hi”, that has white (as hex-color) foreground and green background
Example
use terminal_color_builder::*;
let str = OutputFormatter::new().fg().hex("#fff").bg().green().text("Hi".to_string()).print();
pub fn new() -> Self
Sourcepub fn fg(self) -> OutputColor
pub fn fg(self) -> OutputColor
Set the current context to foreground
Sourcepub fn bg(self) -> OutputColor
pub fn bg(self) -> OutputColor
Set the current context to foreground
Sourcepub fn custom(self, fg: COLORS, bg: COLORS) -> OutputFormatter
pub fn custom(self, fg: COLORS, bg: COLORS) -> OutputFormatter
apply custom color with the COLORS-enum
Example
use terminal_color_builder::*;
use terminal_color_builder::color::COLORS;
let c = OutputFormatter::new().custom(COLORS::White, COLORS::Green).text("Hi".to_string());
Auto Trait Implementations§
impl Freeze for OutputFormatter
impl RefUnwindSafe for OutputFormatter
impl Send for OutputFormatter
impl Sync for OutputFormatter
impl Unpin for OutputFormatter
impl UnwindSafe for OutputFormatter
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