pub enum BasicColor {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
}Expand description
The 8 basic non-bright terminal colors.
These colors are also available as associated constants in the Color enum:
use fluent_ansi::{prelude::*, color::BasicColor};
assert_eq!(Color::RED, BasicColor::Red);
assert_eq!(Color::GREEN, BasicColor::Green);
assert_eq!(Color::BLUE, BasicColor::Blue);
// etc.See Wikipedia’s article on 3-bit and 4-bit colors ANSI escape codes.
Variants§
Black
The black color.
Red
The red color.
Green
The green color.
Yellow
The yellow color.
Blue
The blue color.
Magenta
The magenta color.
Cyan
The cyan color.
White
The white color.
Implementations§
Source§impl BasicColor
impl BasicColor
Sourcepub fn bright(self) -> SimpleColor
pub fn bright(self) -> SimpleColor
Returns a bright variant of this basic color.
Source§impl BasicColor
impl BasicColor
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 BasicColor
impl BasicColor
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 BasicColor
impl BasicColor
Sourcepub fn to_targeted_color(self) -> TargetedColor
pub fn to_targeted_color(self) -> TargetedColor
Converts the type into a TargetedColor
Source§impl BasicColor
impl BasicColor
Sourcepub fn to_simple_color(self) -> SimpleColor
pub fn to_simple_color(self) -> SimpleColor
Convert this basic color into a SimpleColor.
Trait Implementations§
Source§impl Clone for BasicColor
impl Clone for BasicColor
Source§fn clone(&self) -> BasicColor
fn clone(&self) -> BasicColor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more