Index: pkg/stm32/lib/lcd.dart |
diff --git a/pkg/stm32/lib/lcd.dart b/pkg/stm32/lib/lcd.dart |
index 9d1f84d7654fb9bb7afdabff4edf2c4bf71ff6e1..0dc6fc76d08f49b3633f0b363bb7057a1afa8ee8 100644 |
--- a/pkg/stm32/lib/lcd.dart |
+++ b/pkg/stm32/lib/lcd.dart |
@@ -81,18 +81,22 @@ class FrameBuffer { |
int get height => _lcdHeight.icall$0(); |
int get width => _lcdWidth.icall$0(); |
- clear([Color color = Color.black]) { |
- _lcdClear.icall$1(color.rgb8888); |
- } |
+ Color _backgroundColor = Color.white; |
- set foregroundColor(Color color) { |
- _lcdSetForegroundColor.icall$1(color.rgb8888); |
+ clear([Color color]) { |
+ color ??= _backgroundColor; |
+ _lcdClear.icall$1(color.rgb8888); |
} |
set backgroundColor(Color color) { |
+ _backgroundColor = color; |
_lcdSetBackgroundColor.icall$1(color.rgb8888); |
} |
+ set foregroundColor(Color color) { |
+ _lcdSetForegroundColor.icall$1(color.rgb8888); |
+ } |
+ |
Color readPixel(int x, int y) { |
return new Color.fromRgb8888(_lcdReadPixel.icall$2(x, y)); |
} |