pub struct BasicColors {
pub green: ColorSpec,
pub yellow: ColorSpec,
pub red: ColorSpec,
pub hl: ColorSpec,
}
Expand description
A basic selection of colors for printing to the terminal.
This type provides a simple, built-in palette for colorized printing. You
typically won’t need to ever explicitly instantiate it, since it
implements Default
and so does ColorPrintState
:
#[macro_use] extern crate tcprint;
use tcprint::{BasicColors, ColorPrintState};
let mut state = ColorPrintState::<BasicColors>::default();
tcprintln!(state, ("Conditions are "), [green: "green"], ("!"));
The listing of fields below shows which colors are available.
This type implements the ReportingColors
trait. It returns bold green
for ReportType::Info
, bold yellow for ReportType::Warning
, and bold
red for ReportType::Error
.
Fields§
§green: ColorSpec
Bold green.
yellow: ColorSpec
Bold yellow.
red: ColorSpec
Bold red.
hl: ColorSpec
“Highlight”: bold white.
Trait Implementations§
Source§impl Clone for BasicColors
impl Clone for BasicColors
Source§fn clone(&self) -> BasicColors
fn clone(&self) -> BasicColors
Returns a copy 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 Debug for BasicColors
impl Debug for BasicColors
Source§impl Default for BasicColors
impl Default for BasicColors
Source§impl PartialEq for BasicColors
impl PartialEq for BasicColors
Source§impl ReportingColors for BasicColors
impl ReportingColors for BasicColors
Source§fn get_color_for_report(&self, reptype: ReportType) -> &ColorSpec
fn get_color_for_report(&self, reptype: ReportType) -> &ColorSpec
Get a
termcolor::ColorSpec
to be associated with a report message. Read moreimpl Eq for BasicColors
impl StructuralPartialEq for BasicColors
Auto Trait Implementations§
impl Freeze for BasicColors
impl RefUnwindSafe for BasicColors
impl Send for BasicColors
impl Sync for BasicColors
impl Unpin for BasicColors
impl UnwindSafe for BasicColors
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