Struct termcolor::ColorSpec [−][src]
pub struct ColorSpec { /* fields omitted */ }
A color specification.
Methods
impl ColorSpec
[src]
impl ColorSpec
pub fn new() -> ColorSpec
[src]
pub fn new() -> ColorSpec
Create a new color specification that has no colors or styles.
pub fn fg(&self) -> Option<&Color>
[src]
pub fn fg(&self) -> Option<&Color>
Get the foreground color.
pub fn set_fg(&mut self, color: Option<Color>) -> &mut ColorSpec
[src]
pub fn set_fg(&mut self, color: Option<Color>) -> &mut ColorSpec
Set the foreground color.
pub fn bg(&self) -> Option<&Color>
[src]
pub fn bg(&self) -> Option<&Color>
Get the background color.
pub fn set_bg(&mut self, color: Option<Color>) -> &mut ColorSpec
[src]
pub fn set_bg(&mut self, color: Option<Color>) -> &mut ColorSpec
Set the background color.
pub fn bold(&self) -> bool
[src]
pub fn bold(&self) -> bool
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]
pub fn set_bold(&mut self, yes: bool) -> &mut ColorSpec
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]
pub fn underline(&self) -> bool
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]
pub fn set_underline(&mut self, yes: bool) -> &mut ColorSpec
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]
pub fn intense(&self) -> bool
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]
pub fn set_intense(&mut self, yes: bool) -> &mut ColorSpec
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]
pub fn is_none(&self) -> bool
Returns true if this color specification has no colors or styles.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clears this color specification so that it has no color/style settings.
Trait Implementations
impl Clone for ColorSpec
[src]
impl Clone for ColorSpec
fn clone(&self) -> ColorSpec
[src]
fn clone(&self) -> ColorSpec
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ColorSpec
[src]
impl Debug for ColorSpec
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for ColorSpec
[src]
impl Default for ColorSpec
impl Eq for ColorSpec
[src]
impl Eq for ColorSpec
impl PartialEq for ColorSpec
[src]
impl PartialEq for ColorSpec