Enum rsass::value::Color[][src]

pub enum Color {
    Rgba(Rgba),
    Hsla(Hsla),
    Hwba(Hwba),
}

A color in sass/css. May be a Rgba, Hsla, or Hwba value.

Variants

Rgba(Rgba)

A rgba color, defined by red, green, blue and alpha components.

Hsla(Hsla)

A hsla color, defined by its hue, saturation, lightness and alpha.

Hwba(Hwba)

A hwba color, defined by its hue, whiteness, blackness and alpha.

Implementations

impl Color[src]

pub fn to_rgba(&self) -> Cow<'_, Rgba>[src]

Get this color as a rgba value.

If this color is a rgba value, return a borrow of it. Otherwise, do the conversion and return an owned value.

pub fn to_hsla(&self) -> Cow<'_, Hsla>[src]

Get this color as a hsla value.

If this color is a hsla value, return a borrow of it. Otherwise, do the conversion and return an owned value.

pub fn to_hwba(&self) -> Cow<'_, Hwba>[src]

Get this color as a hwba value.

If this color is a hwba value, return a borrow of it. Otherwise, do the conversion and return an owned value.

pub fn get_alpha(&self) -> Rational[src]

Get the alpha channel of this color.

The alpha channel is a rational value between 0 and 1.

pub fn set_alpha(&mut self, alpha: Rational)[src]

Set the alpha channel of this color.

The alpha channel is a rational value between 0 and 1.

pub fn rotate_hue(&self, val: Rational) -> Self[src]

Rotate the hue of this color by a specific number of degrees.

pub fn format(&self, format: Format) -> Formatted<'_, Self>[src]

Get a reference to this Value bound to an output format.

Trait Implementations

impl Clone for Color[src]

impl Debug for Color[src]

impl Eq for Color[src]

impl From<Hsla> for Color[src]

impl From<Hwba> for Color[src]

impl From<Rgba> for Color[src]

impl Ord for Color[src]

impl PartialEq<Color> for Color[src]

impl PartialOrd<Color> for Color[src]

impl StructuralEq for Color[src]

impl StructuralPartialEq for Color[src]

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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