Struct yansi::Paint [] [src]

pub struct Paint<T> { /* fields omitted */ }

A structure encapsulating all of the styling for a given item.

See the crate level documentation for usage information.

Methods

impl<T> Paint<T>
[src]

Constructs a new Paint structure that encapsulates item. No styling is applied.

use yansi::Paint;

assert_eq!(Paint::new("hello!").to_string(), "hello!".to_string());

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the name of this method.

use yansi::Paint;

println!("This is going to be blue: {}", Paint::blue("yay!"));

Constructs a new Paint structure that encapsulates item with the foreground color set RGB color corresponding to r, g, b.

use yansi::Paint;

println!("This is going to be funky: {}", Paint::rgb(70, 130, 122, "hi!"));

Constructs a new Paint structure that encapsulates item with the foreground color set to the fixed color corresponding to color.

use yansi::Paint;

println!("This is going to be funky: {}", Paint::fixed(100, "hi!"));

Sets the foreground to color.

use yansi::Paint;
use yansi::Color::Red;

println!("Red foreground: {}", Paint::new("hi!").fg(Red));

Sets the background to color.

use yansi::Paint;
use yansi::Color::Yellow;

println!("Yellow background: {}", Paint::new("hi!").bg(Yellow));

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Enables the styling corresponding to the name of this method.

use yansi::Paint;

println!("Red, underlined: {}", Paint::red("beep.").underline());

Trait Implementations

impl<T: Default> Default for Paint<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Eq> Eq for Paint<T>
[src]

impl<T: PartialEq> PartialEq for Paint<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Ord> Ord for Paint<T>
[src]

This method returns an Ordering between self and other. Read more

impl<T: PartialOrd> PartialOrd for Paint<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Hash> Hash for Paint<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Copy> Copy for Paint<T>
[src]

impl<T: Clone> Clone for Paint<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Display> Display for Paint<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Debug> Debug for Paint<T>
[src]

Formats the value using the given formatter.