Enum flo_canvas::Color[][src]

pub enum Color {
    Rgba(f32f32f32f32),
    Hsluv(f32f32f32f32),
}

Representation of a colour

Variants

Rgba(f32f32f32f32)
Hsluv(f32f32f32f32)

Implementations

impl Color[src]

pub fn to_rgba_components(&self) -> (f32, f32, f32, f32)[src]

Returns this colour as RGBA components

pub fn to_hsluv_components(&self) -> (f32, f32, f32, f32)[src]

Returns this colour as HSLUV components

pub fn to_format(&self, format: ColorFormat) -> Color[src]

Converts this colour to another format

pub fn with_alpha(&self, new_alpha: f32) -> Color[src]

Returns a new colour that's the same as this one except with a different alpha value

Trait Implementations

impl CanvasEncoding<String> for Color[src]

impl Clone for Color[src]

impl Copy for Color[src]

impl Debug for Color[src]

impl<'de> Deserialize<'de> for Color[src]

impl PartialEq<Color> for Color[src]

impl Serialize for Color[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.