embedded_ui/
color.rs

1use embedded_graphics::{
2    iterator::raw::RawDataSlice,
3    pixelcolor::{raw::BigEndian, BinaryColor},
4};
5use embedded_graphics_core::pixelcolor::PixelColor;
6
7pub trait UiColor: PixelColor + From<<Self as PixelColor>::Raw> + Default
8// where
9//     RawDataSlice<'static, <Self as PixelColor>::Raw, BigEndian>:
10//         IntoIterator<Item = <Self as PixelColor>::Raw>,
11{
12    fn default_background() -> Self;
13    fn default_foreground() -> Self;
14    fn transparent() -> Self;
15}
16
17impl UiColor for BinaryColor {
18    fn default_background() -> Self {
19        Self::Off
20    }
21
22    fn default_foreground() -> Self {
23        Self::On
24    }
25
26    fn transparent() -> Self {
27        Self::Off
28    }
29}