#[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§impl PartialOrd for PremultipliedColorF
impl PartialOrd for PremultipliedColorF
Source§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