#[repr(C)]pub struct Rgba(_);
Expand description
0-1 linear space RGBA
color with premultiplied alpha.
Implementations
sourceimpl Rgba
impl Rgba
pub const TRANSPARENT: Rgba = Rgba::from_rgba_premultiplied(0.0, 0.0, 0.0, 0.0)
pub const BLACK: Rgba = Rgba::from_rgb(0.0, 0.0, 0.0)
pub const WHITE: Rgba = Rgba::from_rgb(1.0, 1.0, 1.0)
pub const RED: Rgba = Rgba::from_rgb(1.0, 0.0, 0.0)
pub const GREEN: Rgba = Rgba::from_rgb(0.0, 1.0, 0.0)
pub const BLUE: Rgba = Rgba::from_rgb(0.0, 0.0, 1.0)
pub const fn from_rgba_premultiplied(r: f32, g: f32, b: f32, a: f32) -> Rgba
pub fn from_rgba_unmultiplied(r: f32, g: f32, b: f32, a: f32) -> Rgba
pub fn from_srgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Rgba
pub fn from_srgba_unmultiplied(r: u8, g: u8, b: u8, a: u8) -> Rgba
pub const fn from_rgb(r: f32, g: f32, b: f32) -> Rgba
pub const fn from_gray(l: f32) -> Rgba
pub fn from_luminance_alpha(l: f32, a: f32) -> Rgba
sourcepub fn from_black_alpha(a: f32) -> Rgba
pub fn from_black_alpha(a: f32) -> Rgba
Transparent black
sourcepub fn from_white_alpha(a: f32) -> Rgba
pub fn from_white_alpha(a: f32) -> Rgba
Transparent white
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
sourceimpl<'de> Deserialize<'de> for Rgba
impl<'de> Deserialize<'de> for Rgba
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Rgba, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Rgba, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Rgba> for Rgba
impl PartialEq<Rgba> for Rgba
sourceimpl Serialize for Rgba
impl Serialize for Rgba
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Rgba
impl Pod for Rgba
impl StructuralPartialEq for Rgba
Auto Trait Implementations
impl RefUnwindSafe for Rgba
impl Send for Rgba
impl Sync for Rgba
impl Unpin for Rgba
impl UnwindSafe for Rgba
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
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
. Read more
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
. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more