#[repr(C)]pub struct Rgba(/* private fields */);
Expand description
0-1 linear space RGBA
color with premultiplied alpha.
Implementations§
Source§impl Rgba
impl Rgba
pub const TRANSPARENT: Self = _
pub const BLACK: Self = _
pub const WHITE: Self = _
pub const RED: Self = _
pub const GREEN: Self = _
pub const BLUE: Self = _
pub const fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn from_srgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn from_srgba_unmultiplied(r: u8, g: u8, b: u8, a: u8) -> Self
pub const fn from_rgb(r: f32, g: f32, b: f32) -> Self
pub const fn from_gray(l: f32) -> Self
pub fn from_luminance_alpha(l: f32, a: f32) -> Self
Sourcepub fn from_black_alpha(a: f32) -> Self
pub fn from_black_alpha(a: f32) -> Self
Transparent black
Sourcepub fn from_white_alpha(a: f32) -> Self
pub fn from_white_alpha(a: f32) -> Self
Transparent white
Sourcepub fn is_additive(self) -> bool
pub fn is_additive(self) -> bool
Is the alpha=0 ?
pub fn r(&self) -> f32
pub fn g(&self) -> f32
pub fn b(&self) -> f32
pub fn a(&self) -> f32
Sourcepub fn to_rgba_unmultiplied(&self) -> [f32; 4]
pub fn to_rgba_unmultiplied(&self) -> [f32; 4]
unmultiply the alpha
Sourcepub fn to_srgba_unmultiplied(&self) -> [u8; 4]
pub fn to_srgba_unmultiplied(&self) -> [u8; 4]
unmultiply the alpha
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rgba
impl<'de> Deserialize<'de> for Rgba
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
impl Copy for Rgba
impl Pod for Rgba
impl StructuralPartialEq for Rgba
Auto Trait Implementations§
impl Freeze for Rgba
impl RefUnwindSafe for Rgba
impl Send for Rgba
impl Sync for Rgba
impl Unpin for Rgba
impl UnwindSafe for Rgba
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.