Struct rainbow::SrgbRgba[][src]

#[repr(transparent)]pub struct SrgbRgba(_);

Implementations

impl SrgbRgba[src]

pub fn zero() -> Self[src]

pub fn one() -> Self[src]

pub const fn from_f32(r: f32, g: f32, b: f32, a: f32) -> Self[src]

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

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

pub const fn from_f32_array(color: [f32; 4]) -> Self[src]

pub fn from_unorm8_array(color: [Unorm8; 4]) -> Self[src]

pub fn from_u8_array(color: [u8; 4]) -> Self[src]

pub const fn into_f32_array(self) -> [f32; 4][src]

pub fn into_unorm8_array(self) -> [Unorm8; 4][src]

pub fn into_u8_array(self) -> [u8; 4][src]

pub fn a(self, alpha: f32) -> Self[src]

Change the alpha channel.

Note that alpha is always pre-multiplied, meaning the RGB channels will be multiplied by this new alpha value. Therefore, calling this more than once may be destructive.

This internally converts to linear color and back, so if you're going to convert to linear as a final step anyway, you should call this after that.

pub fn pma(self) -> Self[src]

Convert to pre-multiplied alpha. This should only be called when consuming data that isn't pre-multiplied.

pub fn to_linear(self) -> LinRgba[src]

Trait Implementations

impl Clone for SrgbRgba[src]

impl Copy for SrgbRgba[src]

impl Debug for SrgbRgba[src]

impl From<[Unorm8; 4]> for SrgbRgba[src]

impl From<[f32; 4]> for SrgbRgba[src]

impl From<[u8; 4]> for SrgbRgba[src]

impl Into<[Unorm8; 4]> for SrgbRgba[src]

impl Into<[f32; 4]> for SrgbRgba[src]

impl Into<[u8; 4]> for SrgbRgba[src]

impl PartialEq<SrgbRgba> for SrgbRgba[src]

impl PartialOrd<SrgbRgba> for SrgbRgba[src]

impl StructuralPartialEq for SrgbRgba[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> Max for T where
    T: PartialOrd<T>, 

impl<T> Min for T where
    T: PartialOrd<T>, 

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.