pub struct TargetedColor { /* private fields */ }Expand description
A color in a specific color target.
Implementations§
Source§impl TargetedColor
impl TargetedColor
Sourcepub fn new(color: impl Into<Color>, target: ColorTarget) -> Self
pub fn new(color: impl Into<Color>, target: ColorTarget) -> Self
Creates a new color for a specific color target.
Sourcepub fn new_for_fg(color: impl Into<Color>) -> Self
pub fn new_for_fg(color: impl Into<Color>) -> Self
Creates a new color for the foreground plane.
Sourcepub fn new_for_bg(color: impl Into<Color>) -> Self
pub fn new_for_bg(color: impl Into<Color>) -> Self
Creates a new color for the background plane.
Sourcepub fn new_for_underline(color: impl Into<Color>) -> Self
pub fn new_for_underline(color: impl Into<Color>) -> Self
Creates a new color for the underline effects.
Sourcepub const fn get_target(self) -> ColorTarget
pub const fn get_target(self) -> ColorTarget
Gets the color target.
Source§impl TargetedColor
impl TargetedColor
Sourcepub fn underline(self) -> Style
pub fn underline(self) -> Style
An alias for Self::solid_underline().
Sourcepub fn solid_underline(self) -> Style
pub fn solid_underline(self) -> Style
Sets the solid underline effect.
Sourcepub fn curly_underline(self) -> Style
pub fn curly_underline(self) -> Style
Sets the curly underline effect.
Sourcepub fn dotted_underline(self) -> Style
pub fn dotted_underline(self) -> Style
Sets the dotted underline effect.
Sourcepub fn dashed_underline(self) -> Style
pub fn dashed_underline(self) -> Style
Sets the dashed underline effect.
Sourcepub fn strikethrough(self) -> Style
pub fn strikethrough(self) -> Style
Sets the strikethrough effect.
Sourcepub fn double_underline(self) -> Style
pub fn double_underline(self) -> Style
Sets the double underline effect.
Sourcepub fn underline_effect(self, underline_effect: UnderlineEffect) -> Style
pub fn underline_effect(self, underline_effect: UnderlineEffect) -> Style
Sets the underline effect.
Sourcepub fn underline_color(self, color: impl Into<Color>) -> Style
pub fn underline_color(self, color: impl Into<Color>) -> Style
Sets the underline color.
Sourcepub fn color(self, targeted_color: impl Into<TargetedColor>) -> Style
pub fn color(self, targeted_color: impl Into<TargetedColor>) -> Style
Sets the given color in a target.
Sourcepub fn add(self, element: impl StylingElement<Style>) -> Style
pub fn add(self, element: impl StylingElement<Style>) -> Style
Adds the given element to the style.
Sourcepub fn applied_to<C: Display>(self, content: C) -> Styled<C>
pub fn applied_to<C: Display>(self, content: C) -> Styled<C>
Applies the styling to the given content, returning a Styled<C> instance.
Trait Implementations§
Source§impl Clone for TargetedColor
impl Clone for TargetedColor
Source§fn clone(&self) -> TargetedColor
fn clone(&self) -> TargetedColor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TargetedColor
impl Debug for TargetedColor
Source§impl Display for TargetedColor
impl Display for TargetedColor
Source§impl From<BasicColor> for TargetedColor
impl From<BasicColor> for TargetedColor
Source§fn from(value: BasicColor) -> Self
fn from(value: BasicColor) -> Self
Converts to this type from the input type.
Source§impl From<Color> for TargetedColor
impl From<Color> for TargetedColor
Source§impl From<IndexedColor> for TargetedColor
impl From<IndexedColor> for TargetedColor
Source§fn from(value: IndexedColor) -> Self
fn from(value: IndexedColor) -> Self
Converts to this type from the input type.
Source§impl From<RGBColor> for TargetedColor
impl From<RGBColor> for TargetedColor
Source§impl From<SimpleColor> for TargetedColor
impl From<SimpleColor> for TargetedColor
Source§fn from(value: SimpleColor) -> Self
fn from(value: SimpleColor) -> Self
Converts to this type from the input type.
Source§impl From<TargetedColor> for Style
impl From<TargetedColor> for Style
Source§fn from(value: TargetedColor) -> Self
fn from(value: TargetedColor) -> Self
Converts to this type from the input type.
Source§impl Hash for TargetedColor
impl Hash for TargetedColor
Source§impl PartialEq for TargetedColor
impl PartialEq for TargetedColor
Source§impl StylingElement<Style> for TargetedColor
impl StylingElement<Style> for TargetedColor
Source§impl<C: Display> StylingElement<Styled<C>> for TargetedColor
impl<C: Display> StylingElement<Styled<C>> for TargetedColor
impl Copy for TargetedColor
impl Eq for TargetedColor
impl StructuralPartialEq for TargetedColor
Auto Trait Implementations§
impl Freeze for TargetedColor
impl RefUnwindSafe for TargetedColor
impl Send for TargetedColor
impl Sync for TargetedColor
impl Unpin for TargetedColor
impl UnwindSafe for TargetedColor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more