AdaptableStyle

Trait AdaptableStyle 

Source
pub trait AdaptableStyle: Default {
    type Color: AdaptableColor;

    // Required methods
    fn get_fg_color(&self) -> Option<Self::Color>;
    fn get_bg_color(&self) -> Option<Self::Color>;
    fn get_underline_color(&self) -> Option<Self::Color>;
    fn fg_color(self, color: Option<Self::Color>) -> Self;
    fn bg_color(self, color: Option<Self::Color>) -> Self;
    fn underline_color(self, color: Option<Self::Color>) -> Self;
}
Expand description

Represents a style that can get and set its color properties.

Required Associated Types§

Source

type Color: AdaptableColor

The color type used for the style properties.

Required Methods§

Source

fn get_fg_color(&self) -> Option<Self::Color>

Returns the foreground color, if set.

Source

fn get_bg_color(&self) -> Option<Self::Color>

Returns the background color, if set.

Source

fn get_underline_color(&self) -> Option<Self::Color>

Returns the underline color, if set.

Source

fn fg_color(self, color: Option<Self::Color>) -> Self

Sets the foreground color.

Source

fn bg_color(self, color: Option<Self::Color>) -> Self

Sets the background color.

Source

fn underline_color(self, color: Option<Self::Color>) -> Self

Sets the underline color.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AdaptableStyle for Style

Available on crate feature convert only.
Source§

type Color = Color

Source§

fn get_fg_color(&self) -> Option<Self::Color>

Source§

fn get_bg_color(&self) -> Option<Self::Color>

Source§

fn get_underline_color(&self) -> Option<Self::Color>

Source§

fn fg_color(self, color: Option<Self::Color>) -> Self

Source§

fn bg_color(self, color: Option<Self::Color>) -> Self

Source§

fn underline_color(self, color: Option<Self::Color>) -> Self

Source§

impl AdaptableStyle for Style

Available on crate features ratatui and convert only.
Source§

type Color = Color

Source§

fn get_fg_color(&self) -> Option<Self::Color>

Source§

fn fg_color(self, color: Option<Self::Color>) -> Self

Source§

fn get_bg_color(&self) -> Option<Self::Color>

Source§

fn bg_color(self, color: Option<Self::Color>) -> Self

Source§

fn get_underline_color(&self) -> Option<Self::Color>

Source§

fn underline_color(self, color: Option<Self::Color>) -> Self

Implementors§