[][src]Struct tiny_skia::PremultipliedColor

pub struct PremultipliedColor { /* fields omitted */ }

A premultiplied RGBA color value, holding four floating point components.

Guarantees

  • All values are in 0..=1 range.
  • RGB components are <= A.

Implementations

impl PremultipliedColor[src]

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

Returns color's red component.

  • The value is guarantee to be in a 0..=1 range.
  • The value is <= alpha.

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

Returns color's green component.

  • The value is guarantee to be in a 0..=1 range.
  • The value is <= alpha.

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

Returns color's blue component.

  • The value is guarantee to be in a 0..=1 range.
  • The value is <= alpha.

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

Returns color's alpha component.

  • The value is guarantee to be in a 0..=1 range.

pub fn demultiply(&self) -> Color[src]

Returns a demultiplied color.

pub fn to_color_u8(&self) -> PremultipliedColorU8[src]

Converts into PremultipliedColorU8.

Trait Implementations

impl Clone for PremultipliedColor[src]

impl Copy for PremultipliedColor[src]

impl Debug for PremultipliedColor[src]

impl PartialEq<PremultipliedColor> for PremultipliedColor[src]

impl StructuralPartialEq for PremultipliedColor[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> 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.