@@ -10,22 +10,28 @@ namespace pimoroni {
10
10
color = c;
11
11
}
12
12
void PicoGraphics_PenInky7::set_pen (uint8_t r, uint8_t g, uint8_t b) {
13
- color = RGB (r, g, b).to_rgb888 () | 0x010101 ;
13
+ color = RGB (r, g, b).to_rgb888 () | 0x7f000000 ;
14
14
}
15
15
int PicoGraphics_PenInky7::create_pen (uint8_t r, uint8_t g, uint8_t b) {
16
- return RGB (r, g, b).to_rgb888 () | 0x010101 ;
16
+ return RGB (r, g, b).to_rgb888 () | 0x7f000000 ;
17
17
}
18
18
int PicoGraphics_PenInky7::create_pen_hsv (float h, float s, float v) {
19
- return RGB::from_hsv (h, s, v).to_rgb888 () | 0x010101 ;
19
+ return RGB::from_hsv (h, s, v).to_rgb888 () | 0x7f000000 ;
20
20
}
21
21
void PicoGraphics_PenInky7::set_pixel (const Point &p) {
22
- if ((color & 0x010101 ) == 0x010101 ) {
22
+ if ((color & 0x7f000000 ) == 0x7f000000 ) {
23
23
set_pixel_dither (p, RGB (color));
24
24
} else {
25
25
driver.write_pixel (p, color & 0x07 );
26
26
}
27
27
}
28
28
void PicoGraphics_PenInky7::set_pixel_span (const Point &p, uint l) {
29
+ if ((color & 0x7f000000 ) == 0x7f000000 ) {
30
+ for (auto x = 0u ; x < l; x++) {
31
+ set_pixel_dither (p + Point (x, 0 ), RGB (color));
32
+ }
33
+ return ;
34
+ }
29
35
driver.write_pixel_span (p, l, color);
30
36
}
31
37
void PicoGraphics_PenInky7::get_dither_candidates (const RGB &col, const RGB *palette, size_t len, std::array<uint8_t , 16 > &candidates) {
0 commit comments