[−][src]Struct owo_colors::Style
Implementations
impl Style
[src]
pub fn new() -> Self
[src]
pub fn style<T>(&self, target: T) -> Styled<T>
[src]
pub fn fg<C: Color>(mut self: Self) -> Self
[src]
Set the foreground color generically
use owo_colors::{OwoColorize, colors::*}; println!("{}", "red foreground".fg::<Red>());
pub fn bg<C: Color>(mut self: Self) -> Self
[src]
Set the background color generically.
use owo_colors::{OwoColorize, colors::*}; println!("{}", "black background".bg::<Black>());
pub fn black(mut self: Self) -> Self
[src]
Change the foreground color to black
pub fn on_black(mut self: Self) -> Self
[src]
Change the foreground color to black
pub fn red(mut self: Self) -> Self
[src]
Change the foreground color to red
pub fn on_red(mut self: Self) -> Self
[src]
Change the foreground color to red
pub fn green(mut self: Self) -> Self
[src]
Change the foreground color to green
pub fn on_green(mut self: Self) -> Self
[src]
Change the foreground color to green
pub fn yellow(mut self: Self) -> Self
[src]
Change the foreground color to yellow
pub fn on_yellow(mut self: Self) -> Self
[src]
Change the foreground color to yellow
pub fn blue(mut self: Self) -> Self
[src]
Change the foreground color to blue
pub fn on_blue(mut self: Self) -> Self
[src]
Change the foreground color to blue
pub fn magenta(mut self: Self) -> Self
[src]
Change the foreground color to magenta
pub fn on_magenta(mut self: Self) -> Self
[src]
Change the foreground color to magenta
pub fn purple(mut self: Self) -> Self
[src]
Change the foreground color to purple
pub fn on_purple(mut self: Self) -> Self
[src]
Change the foreground color to purple
pub fn cyan(mut self: Self) -> Self
[src]
Change the foreground color to cyan
pub fn on_cyan(mut self: Self) -> Self
[src]
Change the foreground color to cyan
pub fn white(mut self: Self) -> Self
[src]
Change the foreground color to white
pub fn on_white(mut self: Self) -> Self
[src]
Change the foreground color to white
pub fn bright_black(mut self: Self) -> Self
[src]
Change the foreground color to bright black
pub fn on_bright_black(mut self: Self) -> Self
[src]
Change the foreground color to bright black
pub fn bright_red(mut self: Self) -> Self
[src]
Change the foreground color to bright red
pub fn on_bright_red(mut self: Self) -> Self
[src]
Change the foreground color to bright red
pub fn bright_green(mut self: Self) -> Self
[src]
Change the foreground color to bright green
pub fn on_bright_green(mut self: Self) -> Self
[src]
Change the foreground color to bright green
pub fn bright_yellow(mut self: Self) -> Self
[src]
Change the foreground color to bright yellow
pub fn on_bright_yellow(mut self: Self) -> Self
[src]
Change the foreground color to bright yellow
pub fn bright_blue(mut self: Self) -> Self
[src]
Change the foreground color to bright blue
pub fn on_bright_blue(mut self: Self) -> Self
[src]
Change the foreground color to bright blue
pub fn bright_magenta(mut self: Self) -> Self
[src]
Change the foreground color to bright magenta
pub fn on_bright_magenta(mut self: Self) -> Self
[src]
Change the foreground color to bright magenta
pub fn bright_purple(mut self: Self) -> Self
[src]
Change the foreground color to bright purple
pub fn on_bright_purple(mut self: Self) -> Self
[src]
Change the foreground color to bright purple
pub fn bright_cyan(mut self: Self) -> Self
[src]
Change the foreground color to bright cyan
pub fn on_bright_cyan(mut self: Self) -> Self
[src]
Change the foreground color to bright cyan
pub fn bright_white(mut self: Self) -> Self
[src]
Change the foreground color to bright white
pub fn on_bright_white(mut self: Self) -> Self
[src]
Change the foreground color to bright white
pub fn bold(mut self: Self) -> Self
[src]
Make the text bold
pub fn dimmed(mut self: Self) -> Self
[src]
Make the text dim
pub fn italic(mut self: Self) -> Self
[src]
Make the text italicized
pub fn underline(mut self: Self) -> Self
[src]
Make the text italicized
pub fn blink(mut self: Self) -> Self
[src]
Make the text blink
pub fn blink_fast(mut self: Self) -> Self
[src]
Make the text blink (but fast!)
pub fn reversed(mut self: Self) -> Self
[src]
Swap the foreground and background colors
pub fn hidden(mut self: Self) -> Self
[src]
Hide the text
pub fn strikethrough(mut self: Self) -> Self
[src]
Cross out the text
pub fn effect(mut self: Self, effect: Effect) -> Self
[src]
pub fn remove_effect(mut self: Self, effect: Effect) -> Self
[src]
pub fn effects(mut self: Self, effects: &[Effect]) -> Self
[src]
pub fn remove_effects(mut self: Self, effects: &[Effect]) -> Self
[src]
pub fn remove_all_effects(mut self: Self) -> Self
[src]
pub fn color<Color: DynColor>(mut self: Self, color: Color) -> Self
[src]
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
,
use owo_colors::{OwoColorize, AnsiColors}; fn main() { println!("{}", "green".color(AnsiColors::Green)); }
pub fn on_color<Color: DynColor>(mut self: Self, color: Color) -> Self
[src]
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
,
use owo_colors::{OwoColorize, AnsiColors}; fn main() { println!("{}", "yellow background".on_color(AnsiColors::BrightYellow)); }
pub fn fg_rgb<const R: u8, const G: u8, const B: u8>(mut self: Self) -> Self
[src]
Set the foreground color to a specific RGB value.
Requires: nightly and the custom
feature.
If nightly is not preferable for you, use OwoColorize::truecolor
pub fn bg_rgb<const R: u8, const G: u8, const B: u8>(mut self: Self) -> Self
[src]
Set the background color to a specific RGB value.
Requires: nightly and the custom
feature.
If nightly is not preferable for you, use OwoColorize::on_truecolor
pub fn truecolor(mut self: Self, r: u8, g: u8, b: u8) -> Self
[src]
Sets the foreground color to an RGB value.
pub fn on_truecolor(mut self: Self, r: u8, g: u8, b: u8) -> Self
[src]
Sets the background color to an RGB value.
Trait Implementations
impl Clone for Style
[src]
fn clone(&self) -> Style
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Style
[src]
impl Debug for Style
[src]
impl Default for Style
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<D> OwoColorize for D
[src]
fn fg<'a, C: Color>(&'a self) -> FgColorDisplay<'a, C, Self>
[src]
fn bg<'a, C: Color>(&'a self) -> BgColorDisplay<'a, C, Self>
[src]
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
[src]
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
[src]
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
[src]
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
[src]
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
[src]
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
[src]
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
[src]
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
[src]
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
[src]
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
[src]
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
[src]
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
[src]
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
[src]
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
[src]
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
[src]
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
[src]
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
[src]
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
[src]
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
[src]
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
[src]
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
[src]
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
[src]
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
[src]
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
[src]
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
[src]
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
[src]
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
[src]
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
[src]
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
[src]
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
[src]
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
[src]
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
[src]
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
[src]
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
[src]
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
[src]
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
[src]
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
[src]
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
[src]
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
[src]
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
[src]
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
[src]
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
[src]
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
[src]
fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>
[src]
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
[src]
fn color<'a, Color: DynColor>(
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self>
[src]
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self>
fn on_color<'a, Color: DynColor>(
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self>
[src]
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self>
fn fg_rgb<'a, const R: u8, const G: u8, const B: u8>(
&'a self
) -> FgColorDisplay<'a, CustomColor<R, G, B>, Self>
[src]
&'a self
) -> FgColorDisplay<'a, CustomColor<R, G, B>, Self>
fn bg_rgb<'a, const R: u8, const G: u8, const B: u8>(
&'a self
) -> BgColorDisplay<'a, CustomColor<R, G, B>, Self>
[src]
&'a self
) -> BgColorDisplay<'a, CustomColor<R, G, B>, Self>
fn truecolor<'a>(
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
[src]
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
fn on_truecolor<'a>(
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
[src]
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
fn style(&self, style: Style) -> Styled<&Self>
[src]
fn if_stdout_tty<'a, Out, ApplyFn>(
&'a self,
apply: ApplyFn
) -> TtyDisplay<'a, StdOut, Self, Out, ApplyFn> where
ApplyFn: Fn(&'a Self) -> Out,
[src]
&'a self,
apply: ApplyFn
) -> TtyDisplay<'a, StdOut, Self, Out, ApplyFn> where
ApplyFn: Fn(&'a Self) -> Out,
fn if_stderr_tty<'a, Out, ApplyFn>(
&'a self,
apply: ApplyFn
) -> TtyDisplay<'a, StdErr, Self, Out, ApplyFn> where
ApplyFn: Fn(&'a Self) -> Out,
[src]
&'a self,
apply: ApplyFn
) -> TtyDisplay<'a, StdErr, Self, Out, ApplyFn> where
ApplyFn: Fn(&'a Self) -> Out,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,