#[repr(C)]pub struct AlphaLast<A, C> { /* private fields */ }Expand description
A contiguous color with alpha last, preceded by other color components.
§Layout
template<typename C, typename A>
struct AlphaLast {
C color;
A alpha;
}Implementations§
Source§impl<A, C> AlphaLast<A, C>
impl<A, C> AlphaLast<A, C>
Sourcepub const fn with_color(alpha: A, color: C) -> Self
pub const fn with_color(alpha: A, color: C) -> Self
Creates a new instance of AlphaFirst with the given color and alpha components.
Sourcepub fn into_inner(self) -> (C, A)
pub fn into_inner(self) -> (C, A)
Consumes and returns the color and alpha components of this color.
Source§impl AlphaLast<f32, Rgb<f32>>
impl AlphaLast<f32, Rgb<f32>>
Sourcepub const fn from_rgba(r: f32, g: f32, b: f32, a: f32) -> Self
pub const fn from_rgba(r: f32, g: f32, b: f32, a: f32) -> Self
Creates a new RGBA color from the individual components.
§Examples
use gem::{alpha::HasAlpha, rgb::{HasRed, HasGreen, HasBlue, Rgbaf32}};
let color = Rgbaf32::from_rgba(1.0, 0.0, 0.0, 1.0);
assert_eq!(color.red(), 1.0);
assert_eq!(color.green(), 0.0);
assert_eq!(color.blue(), 0.0);
assert_eq!(color.alpha(), 1.0);Trait Implementations§
Source§impl<A, C> HasAlpha for AlphaLast<A, C>where
A: Copy,
impl<A, C> HasAlpha for AlphaLast<A, C>where
A: Copy,
Source§impl<A, C> HasBlue for AlphaLast<A, C>
impl<A, C> HasBlue for AlphaLast<A, C>
Source§impl<A, C> HasGreen for AlphaLast<A, C>
impl<A, C> HasGreen for AlphaLast<A, C>
Source§impl<A, C> HasRed for AlphaLast<A, C>
impl<A, C> HasRed for AlphaLast<A, C>
Source§impl<A: Ord, C: Ord> Ord for AlphaLast<A, C>
impl<A: Ord, C: Ord> Ord for AlphaLast<A, C>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<A: PartialOrd, C: PartialOrd> PartialOrd for AlphaLast<A, C>
impl<A: PartialOrd, C: PartialOrd> PartialOrd for AlphaLast<A, C>
impl<A: Copy, C: Copy> Copy for AlphaLast<A, C>
impl<A: Eq, C: Eq> Eq for AlphaLast<A, C>
impl<A, C> Pod for AlphaLast<A, C>where
A: Pod,
C: Pod,
impl<A, C> StructuralPartialEq for AlphaLast<A, C>
Auto Trait Implementations§
impl<A, C> Freeze for AlphaLast<A, C>
impl<A, C> RefUnwindSafe for AlphaLast<A, C>where
C: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, C> Send for AlphaLast<A, C>
impl<A, C> Sync for AlphaLast<A, C>
impl<A, C> Unpin for AlphaLast<A, C>
impl<A, C> UnwindSafe for AlphaLast<A, C>where
C: UnwindSafe,
A: UnwindSafe,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
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.§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.