mirror of
https://github.com/yuri91/ili9341-rs.git
synced 2024-11-28 09:01:01 +00:00
Add color support
This commit is contained in:
parent
905a1c8406
commit
6d82f813bc
1 changed files with 5 additions and 5 deletions
10
src/lib.rs
10
src/lib.rs
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue