Enum better_term::Color[][src]

pub enum Color {
Show 20 variants Black, Red, Green, Yellow, Blue, Purple, Cyan, White, BrightBlack, BrightRed, BrightGreen, BrightYellow, BrightBlue, BrightPurple, BrightCyan, BrightWhite, Fixed(u8), RGB(u8u8u8), Hex(u32), Default,
}
Expand description

Default ansi colors

Example

use better_term::Color;

// prints Hello, world! in green and red
println!("{}Hello, {}world!", Color::BrightGreen, Color::BrightRed);

Variants

Black

Red

Green

Yellow

Blue

Purple

Cyan

White

BrightBlack

BrightRed

BrightGreen

BrightYellow

BrightBlue

BrightPurple

BrightCyan

BrightWhite

Fixed(u8)

Tuple Fields

0: u8

RGB(u8u8u8)

Tuple Fields

0: u8
1: u8
2: u8

Hex(u32)

Tuple Fields

0: u32

Default

Implementations

Convert color to a style with the foreground set to this color

Convert color to a style with the background set to this color

convert a hexadecimal value to an RGB color value (hex example: 0x000000 for black)

Convert to the ansi value within a string (for output with the ansi char)

Convert to the ansi value within a string (for output with the ansi char

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.