pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}Expand description
An 8-bit RGBA color.
Fields§
§r: u8§g: u8§b: u8§a: u8Implementations§
Source§impl Color
impl Color
Sourcepub const TRANSPARENT: Self
pub const TRANSPARENT: Self
Fully transparent black.
Sourcepub const fn to_argb(&self) -> u32
pub const fn to_argb(&self) -> u32
Converts a color to a u32 holding ARGB in its bits, from most significant to least significant.
Sourcepub const fn with_alpha(self, a: u8) -> Self
pub const fn with_alpha(self, a: u8) -> Self
Returns a color with the same RGB channels, but with the alpha channel altered.
Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
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