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<PremultipliedColor> for PremultipliedColor
impl PartialEq<PremultipliedColor> for PremultipliedColor
source§fn 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 ==
.