Enum ncursesw::extend::Color[][src]

#[repr(i32)]
pub enum Color {
    TerminalDefault,
    Dark(BaseColor),
    Light(BaseColor),
    Custom(i32),
}

Variants

TerminalDefault

Dark(BaseColor)

Tuple Fields

Light(BaseColor)

Tuple Fields

Custom(i32)

Tuple Fields

0: i32

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Return the colors (foreground and background) of the color pair.

Example
extern crate ncursesw;

use ncursesw::*;
use ncursesw::extend::*;

start_color()?;

let blue = Color::Dark(BaseColor::Blue);
let yellow = Color::Dark(BaseColor::Yellow);

let color_pair1 = ColorPair::new(1, Colors::new(blue, yellow))?;

let colors = color_pair1.colors()?;

assert!(colors.foreground() == blue && colors.background() == yellow);

Create a new instance of foreground and background colors.

Foreground color.

Background color.

Formats the value using the given formatter. Read more

Performs the conversion.

Parse a string to instance a base color.

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

Example
use std::str::FromStr;

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

assert!(red == Color::Dark(BaseColor::Red));
assert!(green == Color::Dark(BaseColor::Green));
assert!(blue == Color::Dark(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.

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.