Enum ncursesw::BaseColor[][src]

#[repr(i16)]
pub enum BaseColor {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
}
Expand description

One of the 8 base colors.

Variants

Black

Black color

Color #0

Red

Red color

Color #1

Green

Green color

Color #2

Yellow

Yellow color (Red + Green)

Color #3

Blue

Blue color

Color #4

Magenta

Magenta color (Red + Blue)

Color #5

Cyan

Cyan color (Green + Blue)

Color #6

White

White color (Red + Green + Blue)

Color #7

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

Performs the conversion.

Performs the conversion.

Parse a string to instance a base color.

Valid values are ‘black’, ‘red’, ‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, ‘white’

Example
use std::str::FromStr;

let red = BaseColor::from_str("red")?;
let green = BaseColor::from_str("green")?;
let blue = BaseColor::from_str("blue")?;

assert!(red == BaseColor::Red);
assert!(green == BaseColor::Green);
assert!(blue == BaseColor::Blue);

The associated error which can be returned from parsing.

Feeds this value into the given Hasher. Read more

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

Performs the conversion.

Performs the conversion.

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

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.