tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
607 stars 192 forks source link

epd2in13: use better black/white approximation #616

Closed aykevl closed 10 months ago

aykevl commented 11 months ago

The previoius behavior was that entirely black pixels were treated as white, and anything else as black. That's at least counter-intuitive. This patch changes the behavior to actually look at the color values and use a cutoff around medium gray: darker colors are treated as black, and lighter colors are treated as white.

This is a backwards incompatible change, but I think this behavior makes a lot more sense.

deadprogram commented 10 months ago

Thanks for improving this @aykevl and to @conejoninja for review. Now merging.