[−][src]Struct sensehat_screen::color::PixelColor
24-bit RGB color pixel.
This is the fundamental representation for RGB colors.
Fields
red: u8
green: u8
blue: u8
Implementations
impl PixelColor
[src]
pub const BLACK: PixelColor
[src]
pub const RED: PixelColor
[src]
pub const BLUE: PixelColor
[src]
pub const GREEN: PixelColor
[src]
pub const WHITE: PixelColor
[src]
pub const YELLOW: PixelColor
[src]
pub const CYAN: PixelColor
[src]
pub const MAGENTA: PixelColor
[src]
pub fn new(red: u8, green: u8, blue: u8) -> Self
[src]
Create a new LED pixel color.
pub fn from_rgb565_bytes(color: [u8; 2]) -> Self
[src]
Create a new LED pixel color from a pair of RGB565-encoded bytes.
pub fn rgb565(&self) -> [u8; 2]
[src]
Encodes the current LED pixel color into a pair of RGB565-encoded bytes.
pub fn dim(self, mut scale: f32) -> PixelColor
[src]
Sets the brightness of this colour.
The scale
value should be between 0 and 1. Values outside this range
are clamped.
Trait Implementations
impl Clone for PixelColor
[src]
fn clone(&self) -> PixelColor
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PixelColor
[src]
impl Debug for PixelColor
[src]
impl Default for PixelColor
[src]
fn default() -> PixelColor
[src]
impl<'de> Deserialize<'de> for PixelColor
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a> From<&'a PixelColor> for Rgb565
[src]
fn from(color: &'a PixelColor) -> Self
[src]
impl From<(u8, u8, u8)> for PixelColor
[src]
impl From<PixelColor> for Rgb565
[src]
fn from(color: PixelColor) -> Self
[src]
impl From<Rgb565> for PixelColor
[src]
impl Into<(u8, u8, u8)> for PixelColor
[src]
impl PartialEq<PixelColor> for PixelColor
[src]
fn eq(&self, other: &PixelColor) -> bool
[src]
fn ne(&self, other: &PixelColor) -> bool
[src]
impl Serialize for PixelColor
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for PixelColor
[src]
Auto Trait Implementations
impl RefUnwindSafe for PixelColor
[src]
impl Send for PixelColor
[src]
impl Sync for PixelColor
[src]
impl Unpin for PixelColor
[src]
impl UnwindSafe for PixelColor
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,