Struct termcolor::ColorSpec [−][src]
A color specification.
Implementations
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 dimmed(&self) -> bool
[src]
Get whether this is dimmed or not.
Note that the dimmed setting has no effect in a Windows console.
pub fn set_dimmed(&mut self, yes: bool) -> &mut ColorSpec
[src]
Set whether the text is dimmed or not.
Note that the dimmed setting has no effect in a Windows console.
pub fn italic(&self) -> bool
[src]
Get whether this is italic or not.
Note that the italic setting has no effect in a Windows console.
pub fn set_italic(&mut self, yes: bool) -> &mut ColorSpec
[src]
Set whether the text is italicized or not.
Note that the italic 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 reset(&self) -> bool
[src]
Get whether reset is enabled or not.
reset is enabled by default. When disabled and using ANSI escape
sequences, a “reset” code will be emitted every time a ColorSpec
’s
settings are applied.
Note that the reset setting has no effect in a Windows console.
pub fn set_reset(&mut self, yes: bool) -> &mut ColorSpec
[src]
Set whether to reset the terminal whenever color settings are applied.
reset is enabled by default. When disabled and using ANSI escape
sequences, a “reset” code will be emitted every time a ColorSpec
’s
settings are applied.
Typically this is useful if callers have a requirement to more scrupulously manage the exact sequence of escape codes that are emitted when using ANSI for colors.
Note that the reset 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 Clone for ColorSpec
[src]
impl Debug for ColorSpec
[src]
impl Default for ColorSpec
[src]
impl Eq for ColorSpec
[src]
impl PartialEq<ColorSpec> for ColorSpec
[src]
impl StructuralEq for ColorSpec
[src]
impl StructuralPartialEq for ColorSpec
[src]
Auto Trait Implementations
impl RefUnwindSafe for ColorSpec
impl Send for ColorSpec
impl Sync for ColorSpec
impl Unpin for ColorSpec
impl UnwindSafe for ColorSpec
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,