[−][src]Enum term_painter::Color
Lists all possible Colors. It implements ToStyle
so it's possible to call
ToStyle
's methods directly on a Color
variant like:
println!("{}", Color::Red.bold().paint("Red and bold"));
It is not guaranteed that the local terminal supports all of those colors.
As already mentioned in the module documentation, you should use term
directly to check the terminal's capabilities.
Note: Using Color::NotSet
will not reset the color to the default
terminal color.
Variants
Custom(u32)
Trait Implementations
impl Clone for Color
[src]
impl Copy for Color
[src]
impl Debug for Color
[src]
impl Default for Color
[src]
impl Eq for Color
[src]
impl PartialEq<Color> for Color
[src]
impl StructuralEq for Color
[src]
impl StructuralPartialEq for Color
[src]
impl ToStyle for Color
[src]
fn to_style(self) -> Style
[src]
Returns a Style with default values and the self
color as foreground
color.
fn to_mapped_style<F>(self, func: F) -> Style where
F: FnOnce(&mut Style),
[src]
F: FnOnce(&mut Style),
fn fg(self, c: Color) -> Style
[src]
fn bg(self, c: Color) -> Style
[src]
fn bold(self) -> Style
[src]
fn dim(self) -> Style
[src]
fn underline(self) -> Style
[src]
fn not_underline(self) -> Style
[src]
fn blink(self) -> Style
[src]
fn reverse(self) -> Style
[src]
fn secure(self) -> Style
[src]
fn paint<T>(&self, obj: T) -> Painted<T> where
Self: Clone,
[src]
Self: Clone,
fn with<F, R>(&self, f: F) -> R where
F: FnOnce() -> R,
Self: Clone,
[src]
F: FnOnce() -> R,
Self: Clone,
Auto Trait Implementations
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,