Fixed readability issue
This commit is contained in:
parent
1a50ff5cca
commit
3bd7b55010
2 changed files with 5 additions and 3 deletions
|
@ -63,7 +63,7 @@ class Epd7in5bAdapter (EpdAdapter):
|
|||
def __prepare_image__(self, image):
|
||||
buffer = np.array(image)
|
||||
r,g = buffer[:,:,0], buffer[:,:,1]
|
||||
buffer[np.logical_and(r > 240, g > 240)] = [255,255,255]
|
||||
buffer[np.logical_and(r > 220, g > 220)] = [255,255,255]
|
||||
buffer[r > g] = [255,0,0]
|
||||
buffer[r != 255] = [0,0,0]
|
||||
return buffer
|
||||
|
|
|
@ -2,7 +2,7 @@ from DesignEntity import DesignEntity
|
|||
from settings import hours, language
|
||||
from TextDesign import TextDesign
|
||||
from PIL import ImageDraw
|
||||
from Assets import colors, defaultfontsize
|
||||
from Assets import colors, defaultfontsize, fonts
|
||||
from BoxDesign import BoxDesign
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
|
@ -17,6 +17,8 @@ event_title_ypadding = 5
|
|||
line_thickness = 1
|
||||
currenttimeline_thickness = 2
|
||||
|
||||
event_title_font = fonts['bold']
|
||||
|
||||
class HourListDesign (DesignEntity):
|
||||
"""Hours of a day are listed vertically and
|
||||
resemble a timeline."""
|
||||
|
@ -144,7 +146,7 @@ class HourListDesign (DesignEntity):
|
|||
text = event.title
|
||||
text_color = colors["bg"]
|
||||
textbox_size = (size[0] - event_title_xpadding, size[1] - event_title_ypadding)
|
||||
txt = TextDesign(textbox_size, text = text, fontsize=event_title_fontsize, color=text_color, background_color=box_color, wrap=True)
|
||||
txt = TextDesign(textbox_size, text = text, font=event_title_font, fontsize=event_title_fontsize, color=text_color, background_color=box_color, wrap=True)
|
||||
txt.mask = False
|
||||
txt.pos = (pos[0] + event_title_xpadding, pos[1] + event_title_ypadding)
|
||||
self.draw_design(txt)
|
||||
|
|
Loading…
Reference in a new issue