Struct colorful::core::color_string::CString
source · pub struct CString { /* private fields */ }
Implementations
sourceimpl CString
impl CString
pub fn new<S: StrMarker>(cs: S) -> CString
pub fn create_by_text<S: StrMarker>(cs: S, t: String) -> CString
pub fn create_by_fg<S: StrMarker, C: ColorInterface>(cs: S, color: C) -> CString
pub fn create_by_bg<S: StrMarker, C: ColorInterface>(cs: S, color: C) -> CString
pub fn create_by_style<S: StrMarker>(cs: S, style: Style) -> CString
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CString
impl Send for CString
impl Sync for CString
impl Unpin for CString
impl UnwindSafe for CString
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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> Colorful for Twhere
T: StrMarker,
impl<T> Colorful for Twhere
T: StrMarker,
sourcefn color<C>(self, color: C) -> CStringwhere
C: ColorInterface,
fn color<C>(self, color: C) -> CStringwhere
C: ColorInterface,
Set foreground color. Support Color enum and HSL, RGB mode. Read more
fn black(self) -> CString
fn red(self) -> CString
fn green(self) -> CString
fn yellow(self) -> CString
fn blue(self) -> CString
fn magenta(self) -> CString
fn cyan(self) -> CString
fn light_gray(self) -> CString
fn dark_gray(self) -> CString
fn light_red(self) -> CString
fn light_green(self) -> CString
fn light_yellow(self) -> CString
fn light_blue(self) -> CString
fn light_magenta(self) -> CString
fn light_cyan(self) -> CString
fn white(self) -> CString
sourcefn bg_color<C>(self, color: C) -> CStringwhere
C: ColorInterface,
fn bg_color<C>(self, color: C) -> CStringwhere
C: ColorInterface,
Set background color. Support Color enum and HSL, RGB mode. Read more
fn bg_black(self) -> CString
fn bg_red(self) -> CString
fn bg_green(self) -> CString
fn bg_yellow(self) -> CString
fn bg_blue(self) -> CString
fn bg_magenta(self) -> CString
fn bg_cyan(self) -> CString
fn bg_light_gray(self) -> CString
fn bg_dark_gray(self) -> CString
fn bg_light_red(self) -> CString
fn bg_light_green(self) -> CString
fn bg_light_yellow(self) -> CString
fn bg_light_blue(self) -> CString
fn bg_light_magenta(self) -> CString
fn bg_light_cyan(self) -> CString
fn bg_white(self) -> CString
fn bg_rgb(self, r: u8, g: u8, b: u8) -> CString
fn hsl(self, h: f32, s: f32, l: f32) -> CString
fn bg_hsl(self, h: f32, s: f32, l: f32) -> CString
sourcefn style(self, style: Style) -> CString
fn style(self, style: Style) -> CString
Terminal effect
See ANSI escape code
For terminals compatibility, check Terminals compatibility Read more
sourcefn blink(self) -> CString
fn blink(self) -> CString
Turn blinking mode on. Blink doesn’t work in many terminal emulators ,and it will still work on the console.
sourcefn underlined(self) -> CString
fn underlined(self) -> CString
Turn underline mode on.
sourcefn reverse(self) -> CString
fn reverse(self) -> CString
Turn reverse mode on (invert the foreground and background colors).
Turn invisible text mode on (useful for passwords).
sourcefn gradient_with_step<C>(self, color: C, step: f32) -> CStringwhere
C: ColorInterface,
fn gradient_with_step<C>(self, color: C, step: f32) -> CStringwhere
C: ColorInterface,
Apply gradient color to sentences, support multiple lines.
You can use
use colorful::Color;
or use colorful::HSL;
or use colorful::RGB;
to import colors and create gradient string. Read morefn gradient_with_color<C>(self, start: C, stop: C) -> CStringwhere
C: ColorInterface,
fn gradient<C>(self, color: C) -> CStringwhere
C: ColorInterface,
fn rainbow_with_speed(self, speed: i32)
fn neon_with_speed<C>(self, high: C, low: C, speed: i32)where
C: ColorInterface,
sourcefn neon<C>(self, high: C, low: C)where
C: ColorInterface,
fn neon<C>(self, high: C, low: C)where
C: ColorInterface,
Neon mode