mirror of
https://github.com/yuri91/ili9341-rs.git
synced 2024-11-24 07:30:59 +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>>,
|
||||
{
|
||||
for Pixel(pos, color) in item_pixels {
|
||||
use embedded_graphics::pixelcolor::raw::RawData;
|
||||
|
||||
self.draw_raw(
|
||||
pos.x as u16,
|
||||
pos.y as u16,
|
||||
pos.x as u16,
|
||||
pos.y as u16,
|
||||
if color == Rgb565::new(0, 0, 0) {
|
||||
&[0xff, 0xff]
|
||||
} else {
|
||||
&[0, 0]
|
||||
},
|
||||
&embedded_graphics::pixelcolor::raw::RawU16::from(color)
|
||||
.into_inner()
|
||||
.to_le_bytes(),
|
||||
)
|
||||
.expect("Failed to communicate with device");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue