Struct rainbow::LinRgba[][src]

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

Implementations

impl LinRgba[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.

pub fn to_srgb(self) -> SrgbRgba[src]

Trait Implementations

impl Clone for LinRgba[src]

impl Copy for LinRgba[src]

impl Debug for LinRgba[src]

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

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

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

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

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

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

impl PartialEq<LinRgba> for LinRgba[src]

impl PartialOrd<LinRgba> for LinRgba[src]

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