pub fn with_color<F>(&self, c: ColorStyle, f: F)
    where
        F: FnOnce(&Printer),
    {
        self.backend
            .with_color(c.resolve(&self.theme.palette), || f(self));
    }
/// Call the given closure with a colored printer,
/// that will apply the given color on prints.
///
/// # Examples
///
/// ```no_run
/// # use cursive::Printer;
/// # use cursive::theme;
/// # use cursive::backend::{self, Backend};
/// # let b = backend::Concrete::init();
/// # let t = theme::load_default();
/// # let printer = Printer::new((6,4), &t, &b);
/// printer.with_color(theme::ColorStyle::highlight(), |printer| {
///     printer.print((0,0), "This text is highlighted!");
/// });
/// ```
Call the given closure with a colored printer,
that will apply the given color on prints.
Call the given closure with a colored printer that will apply the given color on prints .
pub fn with_color<F>(&self, c: ColorStyle, f: F)
    where
        F: FnOnce(&Printer),
    {
        self.backend
            .with_color(c.resolve(&self.theme.palette), || f(self));
    }
pub fn with_color < F > ( & self , c : ColorStyle , f : F ) where F : FnOnce ( & Printer ) , { self . backend . with_color ( c . resolve ( & self . theme . palette ) , | | f ( self ) ) ; }
Call the given closure with a colored printer,
that will apply the given color on prints.
Call the given closure with a colored printer that will apply the given color on prints .
&self
c
ColorStyle
f
F
&self
c
ColorStyle
f
F
examples
None
use cursive::printer;
None
use cursive::theme;
None
use cursive::backend::{self, backend};
None
let b = backend::concrete::init();
None
let t = theme::load_default();
None
let printer = printer::new((6,4), &t, &b);
printer.with_color(theme::ColorStyle::highlight(), |printer| {
printer.print((0,0), "This text is highlighted!");
});
```
printer . with_color ( theme :: ColorStyle :: highlight () |printer| { printer . print (( 0 0 ) " This text is highlighted! " ) ; } ) ; ` ` `