Fine tuned color recognition

This commit is contained in:
Maximilian Giller 2019-03-09 12:45:30 +01:00
parent bd119bb8f9
commit 8372d78268

View file

@ -65,9 +65,9 @@ class Epd7in5bAdapter (EpdAdapter):
def __get_color__ (self, pixel):
color_percent = self.__get_color_percentage__(pixel)
brightness = self.__brightness__(pixel)
if brightness > 235 or (brightness > 150 and color_percent[0] > 35):
if brightness > 240 or (brightness > 200 and color_percent[0] > 35):
return 'white'
elif color_percent[0] > 50:
elif color_percent[0] > 40:
return 'red'
else:
return 'black'