[][src]Enum badgen::Color

pub enum Color<'a> {
    Green,
    Blue,
    Red,
    Yellow,
    Orange,
    Purple,
    Pink,
    Grey,
    Cyan,
    Black,
    Custom(&'a str),
}

Possible colors for use in a badge.

Variants

Green

green

Blue

blue

Red

red

Yellow

yellow

Orange

orange

Purple

purple

Pink

pink

Grey

grey

Cyan

cyan

Black

black

Custom(&'a str)

A custom hex color in the form RGB or RRGGBB.

Implementations

impl<'a> Color<'a>[src]

pub fn parse(s: &'a str) -> Option<Self>[src]

Parses a color value.

This can be either a RGB hex value, or a named color.

pub fn as_str(&'a self) -> &str[src]

Returns a RGB hex string for the color.

pub fn fmt<W>(&self, w: W) -> Result where
    W: Write
[src]

Writes the color to a fmt::Write.

Trait Implementations

impl<'a> Clone for Color<'a>[src]

impl<'a> Copy for Color<'a>[src]

impl<'a> Debug for Color<'a>[src]

impl<'a> PartialEq<Color<'a>> for Color<'a>[src]

impl<'a> StructuralPartialEq for Color<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Color<'a>

impl<'a> Send for Color<'a>

impl<'a> Sync for Color<'a>

impl<'a> Unpin for Color<'a>

impl<'a> UnwindSafe for Color<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.