Struct tiny_skia::PremultipliedColor
source · [−]pub struct PremultipliedColor { /* private fields */ }
Expand description
A premultiplied RGBA color value, holding four floating point components.
Guarantees
- All values are in 0..=1 range.
- RGB components are <= A.
Implementations
sourceimpl 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
sourceimpl Clone for PremultipliedColor
impl Clone for PremultipliedColor
sourcefn clone(&self) -> PremultipliedColor
fn clone(&self) -> PremultipliedColor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PremultipliedColor
impl Debug for PremultipliedColor
sourceimpl PartialEq<PremultipliedColor> for PremultipliedColor
impl PartialEq<PremultipliedColor> for PremultipliedColor
sourcefn eq(&self, other: &PremultipliedColor) -> bool
fn eq(&self, other: &PremultipliedColor) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PremultipliedColor) -> bool
fn ne(&self, other: &PremultipliedColor) -> bool
This method tests for !=
.
impl Copy for PremultipliedColor
impl StructuralPartialEq for PremultipliedColor
Auto Trait Implementations
impl RefUnwindSafe for PremultipliedColor
impl Send for PremultipliedColor
impl Sync for PremultipliedColor
impl Unpin for PremultipliedColor
impl UnwindSafe for PremultipliedColor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more