pub struct Color {
pub r: U7,
pub g: U7,
pub b: U7,
}Expand description
Represents an RGB color with component values limited to the range [0, 127]. Used for setting custom colors on the Launchkey device.
Fields§
§r: U7§g: U7§b: U7Implementations§
Source§impl Color
impl Color
Sourcepub fn try_new(r: u8, g: u8, b: u8) -> Result<Self, String>
pub fn try_new(r: u8, g: u8, b: u8) -> Result<Self, String>
Tries to create a new Color if all RGB values are within the valid range [0, 127].
Sourcepub fn from_full_range(r: u8, g: u8, b: u8) -> Self
pub fn from_full_range(r: u8, g: u8, b: u8) -> Self
Creates a new Color by converting RGB values from the full range [0, 255] to [0, 127].
Automatically scales down the values.
Trait Implementations§
Source§impl Into<Color> for CommonColor
impl Into<Color> for CommonColor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more