Struct rsass::value::Rgba[][src]

pub struct Rgba { /* fields omitted */ }

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

Implementations

impl Rgba[src]

pub fn new(r: Rational, g: Rational, b: Rational, a: Rational) -> Self[src]

Create a new rgba color.

pub fn from_rgb(r: u8, g: u8, b: u8) -> Self[src]

Create a color from rgb byte values.

pub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Self[src]

Create a color from rgba byte values.

pub fn name(&self) -> Option<&'static str>[src]

If this color is equal to a named color, get the name.

Each component is rounded to its byte value before lookup.

pub fn from_name(name: &str) -> Option<Self>[src]

If name is a known color name, get the corresponding rgba value.

pub fn all_zero(&self) -> bool[src]

Return true if all chanels are zero.

pub fn to_bytes(&self) -> (u8, u8, u8, u8)[src]

Get a (r, g, b, a) byte-value tuple for this color.

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

Get the red component.

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

Get the green component.

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

Get the blue component.

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

Get the alpha value of this color.

Zero is fully transparent, one is fully opaque.

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

Set the alpha value of this color.

Zero is fully transparent, one is fully opaque.

Trait Implementations

impl Add<&'_ Rgba> for &Rgba[src]

type Output = Rgba

The resulting type after applying the + operator.

impl Add<Ratio<i64>> for &Rgba[src]

type Output = Rgba

The resulting type after applying the + operator.

impl Clone for Rgba[src]

impl Debug for Rgba[src]

impl<'a> Div<Ratio<i64>> for &'a Rgba[src]

type Output = Rgba

The resulting type after applying the / operator.

impl Eq for Rgba[src]

impl From<&'_ Hsla> for Rgba[src]

impl From<&'_ Hwba> for Rgba[src]

impl From<&'_ Rgba> for Hsla[src]

impl From<&'_ Rgba> for Hwba[src]

impl From<Rgba> for Color[src]

impl Ord for Rgba[src]

impl PartialEq<Rgba> for Rgba[src]

impl PartialOrd<Rgba> for Rgba[src]

impl StructuralEq for Rgba[src]

impl StructuralPartialEq for Rgba[src]

impl<'a> Sub<&'a Rgba> for &'a Rgba[src]

type Output = Rgba

The resulting type after applying the - operator.

impl<'a> Sub<Ratio<i64>> for &'a Rgba[src]

type Output = Rgba

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Rgba

impl Send for Rgba

impl Sync for Rgba

impl Unpin for Rgba

impl UnwindSafe for Rgba

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