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§
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 copy 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)