[−][src]Trait embedded_graphics::pixelcolor::IntoStorage
Convert a PixelColor
into its underlying storage type
This trait provides the into_storage
method for implementors of PixelColor
. This method
exposes the underlying storage value of a pixel color type.
Examples
Get the u16
representing an Rgb565
color
This example converts an Rgb565
color into its underlying u16
represenation.
use embedded_graphics::{prelude::*, pixelcolor::Rgb565}; let color = Rgb565::new(0x1f, 0x00, 0x0a); let raw = color.into_storage(); assert_eq!(raw, 0b11111_000000_01010u16);
Associated Types
type Storage
The underlying storage type for the pixel color
Required methods
fn into_storage(self) -> Self::Storage
Convert the PixelColor
into its raw storage form
Implementors
impl<C> IntoStorage for C where
C: PixelColor,
C::Raw: From<C>,
[src]
C: PixelColor,
C::Raw: From<C>,