Struct webrender_api::PremultipliedColorF
source · #[repr(C)]pub struct PremultipliedColorF {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
Expand description
Represents pre-multiplied RGBA colors with floating point numbers.
All components must be between 0.0 and 1.0. An alpha value of 1.0 is opaque while 0.0 is fully transparent.
In premultiplied colors transitions to transparent always look “nice” therefore they are used in CSS gradients.
Fields§
§r: f32
§g: f32
§b: f32
§a: f32
Implementations§
source§impl PremultipliedColorF
impl PremultipliedColorF
pub const BLACK: PremultipliedColorF = _
pub const TRANSPARENT: PremultipliedColorF = _
pub const WHITE: PremultipliedColorF = _
pub fn to_array(&self) -> [f32; 4]
Trait Implementations§
source§impl Clone for PremultipliedColorF
impl Clone for PremultipliedColorF
source§fn clone(&self) -> PremultipliedColorF
fn clone(&self) -> PremultipliedColorF
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 PremultipliedColorF
impl Debug for PremultipliedColorF
source§impl<'de> Deserialize<'de> for PremultipliedColorF
impl<'de> Deserialize<'de> for PremultipliedColorF
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for PremultipliedColorF
impl Hash for PremultipliedColorF
source§impl Ord for PremultipliedColorF
impl Ord for PremultipliedColorF
source§impl PartialEq for PremultipliedColorF
impl PartialEq for PremultipliedColorF
source§fn eq(&self, other: &PremultipliedColorF) -> bool
fn eq(&self, other: &PremultipliedColorF) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PremultipliedColorF
impl PartialOrd for PremultipliedColorF
source§fn partial_cmp(&self, other: &PremultipliedColorF) -> Option<Ordering>
fn partial_cmp(&self, other: &PremultipliedColorF) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for PremultipliedColorF
impl Serialize for PremultipliedColorF
impl Copy for PremultipliedColorF
impl Eq for PremultipliedColorF
impl StructuralPartialEq for PremultipliedColorF
Auto Trait Implementations§
impl Freeze for PremultipliedColorF
impl RefUnwindSafe for PremultipliedColorF
impl Send for PremultipliedColorF
impl Sync for PremultipliedColorF
impl Unpin for PremultipliedColorF
impl UnwindSafe for PremultipliedColorF
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