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§
Sourcetype Color: AdaptableColor
type Color: AdaptableColor
The color type used for the style properties.
Required Methods§
Sourcefn get_fg_color(&self) -> Option<Self::Color>
fn get_fg_color(&self) -> Option<Self::Color>
Returns the foreground color, if set.
Sourcefn get_bg_color(&self) -> Option<Self::Color>
fn get_bg_color(&self) -> Option<Self::Color>
Returns the background color, if set.
Sourcefn get_underline_color(&self) -> Option<Self::Color>
fn get_underline_color(&self) -> Option<Self::Color>
Returns the underline color, if set.
Sourcefn underline_color(self, color: Option<Self::Color>) -> Self
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.
impl AdaptableStyle for Style
Available on crate feature
convert only.type Color = Color
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
Source§impl AdaptableStyle for Style
Available on crate features ratatui and convert only.
impl AdaptableStyle for Style
Available on crate features
ratatui and convert only.