Struct chargrid_runtime::Rgba32
[−]Fields
r: u8
g: u8
b: u8
a: u8
Implementations
impl Rgba32
impl Rgba32
pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Rgba32
pub const fn new_rgb(r: u8, g: u8, b: u8) -> Rgba32
pub const fn new_grey(x: u8) -> Rgba32
pub const fn hex(hex: u32) -> Rgba32
pub const fn hex_rgb(hex: u32) -> Rgba32
pub const fn to_rgb24(self) -> Rgb24
pub fn to_f32_array_01(self) -> [f32; 4]
pub fn to_f32_array_rgb_01(self) -> [f32; 3]
pub const fn with_r(self, r: u8) -> Rgba32
pub const fn with_g(self, g: u8) -> Rgba32
pub const fn with_b(self, b: u8) -> Rgba32
pub const fn with_a(self, a: u8) -> Rgba32
pub const fn linear_interpolate(self, to: Rgba32, by: u8) -> Rgba32
pub fn alpha_composite(self, below: Rgba32) -> Rgba32
pub const fn normalised_scalar_mul(self, scalar: u8) -> Rgba32
pub const fn saturating_scalar_mul_div(
self,
numerator: u32,
denominator: u32
) -> Rgba32
pub const fn normalised_mul(self, other: Rgba32) -> Rgba32
Trait Implementations
impl Ord for Rgba32
impl Ord for Rgba32
impl PartialOrd<Rgba32> for Rgba32
impl PartialOrd<Rgba32> for Rgba32
pub fn partial_cmp(&self, other: &Rgba32) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Rgba32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for Rgba32
impl Eq for Rgba32
impl StructuralEq for Rgba32
impl StructuralPartialEq for Rgba32
Auto Trait Implementations
impl RefUnwindSafe for Rgba32
impl Send for Rgba32
impl Sync for Rgba32
impl Unpin for Rgba32
impl UnwindSafe for Rgba32
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more