Enum ansi_term::Colour [] [src]

pub enum Colour {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Purple,
    Cyan,
    White,
    Fixed(u8),
}

A colour is one specific type of ANSI escape code, and can refer to either the foreground or background colour.

These use the standard numeric sequences. See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

Variants

Black
Red
Green
Yellow
Blue
Purple
Cyan
White
Fixed

Methods

impl Colour

fn normal(self) -> Style

Return a Style with the foreground colour set to this colour.

fn paint(self, input: &str) -> ANSIString

Paints the given text with this colour, returning an ANSI string. This is a short-cut so you don't have to use Blue.normal() just to get blue text.

fn bold(self) -> Style

Returns a Style with the bold property set.

fn dimmed(self) -> Style

Returns a Style with the dimmed property set.

fn italic(self) -> Style

Returns a Style with the italic property set.

fn underline(self) -> Style

Returns a Style with the underline property set.

Returns a Style with the blink property set.

fn reverse(self) -> Style

Returns a Style with the reverse property set.

fn hidden(self) -> Style

Returns a Style with the hidden property set.

fn on(self, background: Colour) -> Style

Returns a Style with the background colour property set.

Trait Implementations

Derived Implementations

impl Debug for Colour

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for Colour

impl Clone for Colour

fn clone(&self) -> Colour

fn clone_from(&mut self, source: &Self)

impl PartialEq for Colour

fn eq(&self, __arg_0: &Colour) -> bool

fn ne(&self, __arg_0: &Colour) -> bool