[][src]Struct toggle_florp::Color

pub struct Color(pub u8, pub u8, pub u8);

A simple wrapper for a color

Implementations

impl Color[src]

#[must_use]pub fn random() -> Color[src]

Generates a new random color

#[must_use]pub fn new(r: u8, g: u8, b: u8) -> Color[src]

Generates a new color from the given r g b values

#[must_use]pub fn from_hash(s: &str) -> Color[src]

Generates a new color from the given r g b values

#[must_use]pub fn from_message(s: &str) -> Color[src]

If one wants to use this library to parse something from twitch, this is the method to do just that.

#[must_use]pub fn r(&self) -> u8[src]

Returns the red part of the color

#[must_use]pub fn g(&self) -> u8[src]

Returns the green part of the color

#[must_use]pub fn b(&self) -> u8[src]

Returns the blue part of the color

Trait Implementations

impl Debug for Color[src]

impl FromStr for Color[src]

type Err = String

The associated error which can be returned from parsing.

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

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,