Add color support

This commit is contained in:
David Flemström 2019-12-17 11:06:54 +01:00
parent 905a1c8406
commit 6d82f813bc

View file

@ -295,16 +295,16 @@ where
T: IntoIterator<Item = drawable::Pixel<Rgb565>>, T: IntoIterator<Item = drawable::Pixel<Rgb565>>,
{ {
for Pixel(pos, color) in item_pixels { for Pixel(pos, color) in item_pixels {
use embedded_graphics::pixelcolor::raw::RawData;
self.draw_raw( self.draw_raw(
pos.x as u16, pos.x as u16,
pos.y as u16, pos.y as u16,
pos.x as u16, pos.x as u16,
pos.y as u16, pos.y as u16,
if color == Rgb565::new(0, 0, 0) { &embedded_graphics::pixelcolor::raw::RawU16::from(color)
&[0xff, 0xff] .into_inner()
} else { .to_le_bytes(),
&[0, 0]
},
) )
.expect("Failed to communicate with device"); .expect("Failed to communicate with device");
} }