pub struct IndexedColor(pub u8);Expand description
An 8-bit color type representing colors in the 256-color ANSI palette.
These colors are also available from the method Color::indexed():
use fluent_ansi::{prelude::*, color::IndexedColor};
assert_eq!(Color::indexed(127), IndexedColor(127));See Wikipedia’s article on 8-bit colors ANSI escape codes.
Tuple Fields§
§0: u8Implementations§
Source§impl IndexedColor
impl IndexedColor
Source§impl IndexedColor
impl IndexedColor
Sourcepub fn for_fg(self) -> TargetedColor
pub fn for_fg(self) -> TargetedColor
Associate this color with the foreground plane.
Sourcepub fn for_bg(self) -> TargetedColor
pub fn for_bg(self) -> TargetedColor
Associate this color with the background plane.
Sourcepub fn for_underline(self) -> TargetedColor
pub fn for_underline(self) -> TargetedColor
Associate this color with the underline effect.
Sourcepub fn for_target(self, target: ColorTarget) -> TargetedColor
pub fn for_target(self, target: ColorTarget) -> TargetedColor
Associate this color with the specified color target.
Source§impl IndexedColor
impl IndexedColor
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.
Source§impl IndexedColor
impl IndexedColor
Sourcepub fn to_targeted_color(self) -> TargetedColor
pub fn to_targeted_color(self) -> TargetedColor
Converts the type into a TargetedColor
Trait Implementations§
Source§impl Clone for IndexedColor
impl Clone for IndexedColor
Source§fn clone(&self) -> IndexedColor
fn clone(&self) -> IndexedColor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more