Struct cursive::theme::ColorStyle
source · [−]Expand description
Possible color style for a cell.
Represents a color pair role to use when printing something.
The current theme will assign each role a foreground and background color.
The Default
value is to inherit the parent’s colors.
Fields
front: ColorType
Color used for the foreground (the text itself).
back: ColorType
Color used for the background.
Implementations
sourceimpl ColorStyle
impl ColorStyle
sourcepub fn new<F, B>(front: F, back: B) -> ColorStyle where
F: Into<ColorType>,
B: Into<ColorType>,
pub fn new<F, B>(front: F, back: B) -> ColorStyle where
F: Into<ColorType>,
B: Into<ColorType>,
Creates
sourcepub fn front<F>(front: F) -> ColorStyle where
F: Into<ColorType>,
pub fn front<F>(front: F) -> ColorStyle where
F: Into<ColorType>,
Uses the given color as front, inherits the parent background color.
sourcepub fn back<B>(back: B) -> ColorStyle where
B: Into<ColorType>,
pub fn back<B>(back: B) -> ColorStyle where
B: Into<ColorType>,
Uses the given color as background, inherits the parent front color.
sourcepub fn inherit_parent() -> ColorStyle
pub fn inherit_parent() -> ColorStyle
Uses ColorType::InheritParent
for both front and background.
sourcepub fn terminal_default() -> ColorStyle
pub fn terminal_default() -> ColorStyle
Style set by terminal before entering a Cursive program.
sourcepub fn background() -> ColorStyle
pub fn background() -> ColorStyle
Application background, where no view is present.
sourcepub fn shadow() -> ColorStyle
pub fn shadow() -> ColorStyle
Color used by view shadows. Only background matters.
sourcepub fn primary() -> ColorStyle
pub fn primary() -> ColorStyle
Main text with default background.
sourcepub fn secondary() -> ColorStyle
pub fn secondary() -> ColorStyle
Secondary text color, with default background.
sourcepub fn tertiary() -> ColorStyle
pub fn tertiary() -> ColorStyle
Tertiary text color, with default background.
sourcepub fn title_primary() -> ColorStyle
pub fn title_primary() -> ColorStyle
Title text color with default background.
sourcepub fn title_secondary() -> ColorStyle
pub fn title_secondary() -> ColorStyle
Alternative color for a title.
sourcepub fn highlight() -> ColorStyle
pub fn highlight() -> ColorStyle
Alternate text with highlight background.
sourcepub fn highlight_inactive() -> ColorStyle
pub fn highlight_inactive() -> ColorStyle
Highlight color for inactive views (not in focus).
sourcepub fn merge(a: ColorStyle, b: ColorStyle) -> ColorStyle
pub fn merge(a: ColorStyle, b: ColorStyle) -> ColorStyle
Merge the style b
over style a
.
This merges the front and back color types of a
and b
.
Trait Implementations
sourceimpl Clone for ColorStyle
impl Clone for ColorStyle
sourcefn clone(&self) -> ColorStyle
fn clone(&self) -> ColorStyle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ColorStyle
impl Debug for ColorStyle
sourceimpl Default for ColorStyle
impl Default for ColorStyle
sourcefn default() -> ColorStyle
fn default() -> ColorStyle
Returns the “default value” for a type. Read more
sourceimpl<F, B> From<(F, B)> for ColorStyle where
F: Into<ColorType>,
B: Into<ColorType>,
impl<F, B> From<(F, B)> for ColorStyle where
F: Into<ColorType>,
B: Into<ColorType>,
sourcefn from((F, B)) -> ColorStyle
fn from((F, B)) -> ColorStyle
Converts to this type from the input type.
sourceimpl From<BaseColor> for ColorStyle
impl From<BaseColor> for ColorStyle
sourcefn from(color: BaseColor) -> ColorStyle
fn from(color: BaseColor) -> ColorStyle
Converts to this type from the input type.
sourceimpl From<Color> for ColorStyle
impl From<Color> for ColorStyle
sourcefn from(color: Color) -> ColorStyle
fn from(color: Color) -> ColorStyle
Converts to this type from the input type.
sourceimpl From<ColorStyle> for Style
impl From<ColorStyle> for Style
sourcefn from(color: ColorStyle) -> Style
fn from(color: ColorStyle) -> Style
Converts to this type from the input type.
sourceimpl From<ColorType> for ColorStyle
impl From<ColorType> for ColorStyle
sourcefn from(color: ColorType) -> ColorStyle
fn from(color: ColorType) -> ColorStyle
Converts to this type from the input type.
sourceimpl From<PaletteColor> for ColorStyle
impl From<PaletteColor> for ColorStyle
sourcefn from(color: PaletteColor) -> ColorStyle
fn from(color: PaletteColor) -> ColorStyle
Converts to this type from the input type.
sourceimpl Hash for ColorStyle
impl Hash for ColorStyle
sourceimpl PartialEq<ColorStyle> for ColorStyle
impl PartialEq<ColorStyle> for ColorStyle
sourcefn eq(&self, other: &ColorStyle) -> bool
fn eq(&self, other: &ColorStyle) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ColorStyle) -> bool
fn ne(&self, other: &ColorStyle) -> bool
This method tests for !=
.
impl Copy for ColorStyle
impl Eq for ColorStyle
impl StructuralEq for ColorStyle
impl StructuralPartialEq for ColorStyle
Auto Trait Implementations
impl RefUnwindSafe for ColorStyle
impl Send for ColorStyle
impl Sync for ColorStyle
impl Unpin for ColorStyle
impl UnwindSafe for ColorStyle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more