Struct rainbow::SrgbRgba [−][src]
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]
fn partial_cmp(&self, other: &SrgbRgba) -> Option<Ordering>
[src]
fn lt(&self, other: &SrgbRgba) -> bool
[src]
fn le(&self, other: &SrgbRgba) -> bool
[src]
fn gt(&self, other: &SrgbRgba) -> bool
[src]
fn ge(&self, other: &SrgbRgba) -> bool
[src]
impl StructuralPartialEq for SrgbRgba
[src]
Auto Trait Implementations
impl RefUnwindSafe for SrgbRgba
[src]
impl Send for SrgbRgba
[src]
impl Sync for SrgbRgba
[src]
impl Unpin for SrgbRgba
[src]
impl UnwindSafe for SrgbRgba
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Max for T where
T: PartialOrd<T>,
T: PartialOrd<T>,
pub fn max(self, other: T) -> T
impl<T> Min for T where
T: PartialOrd<T>,
T: PartialOrd<T>,
pub fn min(self, other: T) -> T
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,