pub struct PremultipliedColor {
    r: NormalizedF32,
    g: NormalizedF32,
    b: NormalizedF32,
    a: NormalizedF32,
}Expand description
A premultiplied RGBA color value, holding four floating point components.
§Guarantees
- All values are in 0..=1 range.
 - RGB components are <= A.
 
Fields§
§r: NormalizedF32§g: NormalizedF32§b: NormalizedF32§a: NormalizedF32Implementations§
Source§impl PremultipliedColor
 
impl PremultipliedColor
Sourcepub fn red(&self) -> f32
 
pub fn red(&self) -> f32
Returns color’s red component.
- The value is guarantee to be in a 0..=1 range.
 - The value is <= alpha.
 
Sourcepub fn green(&self) -> f32
 
pub fn green(&self) -> f32
Returns color’s green component.
- The value is guarantee to be in a 0..=1 range.
 - The value is <= alpha.
 
Sourcepub fn blue(&self) -> f32
 
pub fn blue(&self) -> f32
Returns color’s blue component.
- The value is guarantee to be in a 0..=1 range.
 - The value is <= alpha.
 
Sourcepub fn alpha(&self) -> f32
 
pub fn alpha(&self) -> f32
Returns color’s alpha component.
- The value is guarantee to be in a 0..=1 range.
 
Sourcepub fn demultiply(&self) -> Color
 
pub fn demultiply(&self) -> Color
Returns a demultiplied color.
Sourcepub fn to_color_u8(&self) -> PremultipliedColorU8
 
pub fn to_color_u8(&self) -> PremultipliedColorU8
Converts into PremultipliedColorU8.
Trait Implementations§
Source§impl Clone for PremultipliedColor
 
impl Clone for PremultipliedColor
Source§fn clone(&self) -> PremultipliedColor
 
fn clone(&self) -> PremultipliedColor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for PremultipliedColor
 
impl Debug for PremultipliedColor
Source§impl PartialEq for PremultipliedColor
 
impl PartialEq for PremultipliedColor
impl Copy for PremultipliedColor
impl StructuralPartialEq for PremultipliedColor
Auto Trait Implementations§
impl Freeze for PremultipliedColor
impl RefUnwindSafe for PremultipliedColor
impl Send for PremultipliedColor
impl Sync for PremultipliedColor
impl Unpin for PremultipliedColor
impl UnwindSafe for PremultipliedColor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more