[−][src]Struct termcolor::ColorSpec
A color specification.
Methods
impl ColorSpec[src]
pub fn new() -> ColorSpec[src]
Create a new color specification that has no colors or styles.
pub fn fg(&self) -> Option<&Color>[src]
Get the foreground color.
pub fn set_fg(&mut self, color: Option<Color>) -> &mut ColorSpec[src]
Set the foreground color.
pub fn bg(&self) -> Option<&Color>[src]
Get the background color.
pub fn set_bg(&mut self, color: Option<Color>) -> &mut ColorSpec[src]
Set the background color.
pub fn bold(&self) -> bool[src]
Get whether this is bold or not.
Note that the bold setting has no effect in a Windows console.
pub fn set_bold(&mut self, yes: bool) -> &mut ColorSpec[src]
Set whether the text is bolded or not.
Note that the bold setting has no effect in a Windows console.
pub fn underline(&self) -> bool[src]
Get whether this is underline or not.
Note that the underline setting has no effect in a Windows console.
pub fn set_underline(&mut self, yes: bool) -> &mut ColorSpec[src]
Set whether the text is underlined or not.
Note that the underline setting has no effect in a Windows console.
pub fn intense(&self) -> bool[src]
Get whether this is intense or not.
On Unix-like systems, this will output the ANSI escape sequence that will print a high-intensity version of the color specified.
On Windows systems, this will output the ANSI escape sequence that will print a brighter version of the color specified.
pub fn set_intense(&mut self, yes: bool) -> &mut ColorSpec[src]
Set whether the text is intense or not.
On Unix-like systems, this will output the ANSI escape sequence that will print a high-intensity version of the color specified.
On Windows systems, this will output the ANSI escape sequence that will print a brighter version of the color specified.
pub fn is_none(&self) -> bool[src]
Returns true if this color specification has no colors or styles.
pub fn clear(&mut self)[src]
Clears this color specification so that it has no color/style settings.
Trait Implementations
impl Default for ColorSpec[src]
impl PartialEq<ColorSpec> for ColorSpec[src]
impl Eq for ColorSpec[src]
impl Clone for ColorSpec[src]
fn clone(&self) -> ColorSpec[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for ColorSpec[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,