From 7224c33523027a7b16d0f3d50051c6c557ef3dc5 Mon Sep 17 00:00:00 2001 From: chux0519 Date: Fri, 15 Nov 2019 18:51:16 +0800 Subject: [PATCH] fix: stroke color --- src/main.rs | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5ea01b3..313c4a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use embedded_graphics::fonts::Font6x8; +use embedded_graphics::pixelcolor::BinaryColor; use embedded_graphics::prelude::*; use embedded_graphics::primitives::{Circle, Line, Rectangle}; use embedded_graphics::Drawing; @@ -14,13 +15,33 @@ fn main() { disp.init().unwrap(); disp.flush().unwrap(); - disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16)).into_iter()); - disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16)).into_iter()); - disp.draw(Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16)).into_iter()); + disp.draw( + Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16)) + .stroke(Some(BinaryColor::On)) + .into_iter(), + ); + disp.draw( + Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16)) + .stroke(Some(BinaryColor::On)) + .into_iter(), + ); + disp.draw( + Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16)) + .stroke(Some(BinaryColor::On)) + .into_iter(), + ); - disp.draw(Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16)).into_iter()); + disp.draw( + Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16)) + .stroke(Some(BinaryColor::On)) + .into_iter(), + ); - disp.draw(Circle::new(Point::new(96, 16 + 8), 8).into_iter()); + disp.draw( + Circle::new(Point::new(96, 16 + 8), 8) + .stroke(Some(BinaryColor::On)) + .into_iter(), + ); let local_addr = machine_ip::get().unwrap();