Enum easy_sgr::discrete::Color

source ·
pub enum Color {
Show 22 variants BlackFg, RedFg, GreenFg, YellowFg, BlueFg, MagentaFg, CyanFg, WhiteFg, ByteFg(u8), RgbFg(u8, u8, u8), DefaultFg, BlackBg, RedBg, GreenBg, YellowBg, BlueBg, MagentaBg, CyanBg, WhiteBg, ByteBg(u8), RgbBg(u8, u8, u8), DefaultBg,
}
Expand description

A SGR color code

Variants§

§

BlackFg

Represents the SGR code 30

§

RedFg

Represents the SGR code 31

§

GreenFg

Represents the SGR code 32

§

YellowFg

Represents the SGR code 33

§

BlueFg

Represents the SGR code 34

§

MagentaFg

Represents the SGR code 35

§

CyanFg

Represents the SGR code 36

§

WhiteFg

Represents the SGR code 37

§

ByteFg(u8)

Represents the SGR codes 38;2;<n>

Where <n> is an 8 bit color

§

RgbFg(u8, u8, u8)

Represents the SGR codes 38;2;<n1>;<n2>;<n3>

Where <n1>,<n2>,<n3> are 8 bit colors

§

DefaultFg

Represents the SGR code 39

§

BlackBg

Represents the SGR code 40

§

RedBg

Represents the SGR code 41

§

GreenBg

Represents the SGR code 42

§

YellowBg

Represents the SGR code 43

§

BlueBg

Represents the SGR code 44

§

MagentaBg

Represents the SGR code 45

§

CyanBg

Represents the SGR code 46

§

WhiteBg

Represents the SGR code 47

§

ByteBg(u8)

Represents the SGR codes 48;2;<n>

Where <n> is an 8 bit color

§

RgbBg(u8, u8, u8)

Represents the SGR codes 38;2;<n1>;<n2>;<n3>

Where <n1>,<n2>,<n3> are 8 bit colors

§

DefaultBg

Represents the SGR code 49

Trait Implementations§

source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DiscreteSGR for Color

source§

fn write<W>(&self, builder: &mut SGRBuilder<'_, W>)where W: SGRWriter,

Writes a set of SGR codes to the given SGRWriter Read more
source§

fn standard_display(&self, f: &mut Formatter<'_>) -> Result

Writes an SGR sequence to the given Formatter Read more
source§

impl Display for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Color> for SGRString

source§

fn from(value: Color) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<I> EasySGR for Iwhere I: Into<SGRString>,

source§

fn to_sgr(self) -> SGRString

Turns self into SGRString Read more
source§

fn text(self, text: impl Into<String>) -> SGRString

Sets the normal text of the returned SGRString
source§

fn style(self, style: impl Into<Style>) -> SGRString

Adds a style to the returned SGRString
source§

fn color(self, color: impl Into<Color>) -> SGRString

Adds a color(foreground or background) to the returned SGRString
source§

fn custom(self, code: impl Into<u8>) -> SGRString

Adds a custom code to the returned SGRString Read more
source§

fn clean(self, clean: impl Into<CleanKind>) -> SGRString

Sets the CleanKind variant of the returned SGRString
source§

fn custom_place(self, code: impl Into<u8>) -> SGRString

Adds a custom code to be written before the returned SGRString’s text
source§

fn custom_clean(self, code: impl Into<u8>) -> SGRString

Adds a custom code to be written after the returned SGRString’s text
source§

impl<W, D> EasyWrite<W> for Dwhere W: SGRWriter, D: DiscreteSGR,

source§

fn sgr(&self, builder: &mut SGRBuilder<'_, W>)

Writes a set of codes to the builder

Uses DiscreteSGR::write

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.