pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
}Expand description
Represents an RGB color.
Fields§
§r: u8Red component (0-255)
g: u8Green component (0-255)
b: u8Blue component (0-255)
Implementations§
Source§impl Color
impl Color
Sourcepub const fn from_rgb24(rgb: u32) -> Self
pub const fn from_rgb24(rgb: u32) -> Self
Create a color from a 24-bit RGB value.
Sourcepub const fn to_apa102_data(&self) -> u32
pub const fn to_apa102_data(&self) -> u32
Convert to a 32-bit value for APA102 LEDs. Format: 0xRRGGBB00 (red in high bits, blue shifted left by 8)
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