Skip to content

Commit 80fab77

Browse files
committed
Inky 7.3: Remove side-effect from set_pixel_dither.
Do not change "color" when dithering the same colour across multiple pixels.
1 parent c9f6dfe commit 80fab77

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libraries/pico_graphics/pico_graphics_pen_inky7.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace pimoroni {
1515
int PicoGraphics_PenInky7::create_pen(uint8_t r, uint8_t g, uint8_t b) {
1616
return RGB(r, g, b).to_rgb888() | 0x010101;
1717
}
18-
int PicoGraphics_PenInky7::create_pen_hsv(float h, float s, float v) {
19-
return RGB::from_hsv(h, s, v).to_rgb888();
20-
}
18+
int PicoGraphics_PenInky7::create_pen_hsv(float h, float s, float v) {
19+
return RGB::from_hsv(h, s, v).to_rgb888() | 0x010101;
20+
}
2121
void PicoGraphics_PenInky7::set_pixel(const Point &p) {
2222
if ((color & 0x010101) == 0x010101) {
2323
set_pixel_dither(p, RGB(color));
@@ -68,8 +68,7 @@ namespace pimoroni {
6868

6969
// set the pixel
7070
//color = candidates[pattern[pattern_index]];
71-
color = candidate_cache[cache_key][dither16_pattern[pattern_index]];
72-
set_pixel(p);
71+
driver.write_pixel(p, candidate_cache[cache_key][dither16_pattern[pattern_index]] & 0x07);
7372
}
7473
void PicoGraphics_PenInky7::frame_convert(PenType type, conversion_callback_func callback) {
7574
if(type == PEN_INKY7) {

0 commit comments

Comments
 (0)