pub struct Color(pub u8, pub u8, pub u8, pub u8);Expand description
RGBA color used by the renderer.
Tuple Fields§
§0: u8Red component in the range 0..=255.
1: u8Green component in the range 0..=255.
2: u8Blue component in the range 0..=255.
3: u8Alpha component in the range 0..=255.
A value of 255 is fully opaque and 0 is fully transparent.
Implementations§
Source§impl Color
impl Color
Sourcepub fn to_argb8888(self) -> u32
pub fn to_argb8888(self) -> u32
Convert this color to a packed ARGB8888 integer.
Used by display backends in the
rlvgl-platform crate.
Sourcepub fn with_alpha(self, opacity: u8) -> Color
pub fn with_alpha(self, opacity: u8) -> Color
Return a copy with the alpha channel multiplied by opacity.
Both the existing alpha and opacity are in 0..=255.
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 UnsafeUnpin 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