added flashing : sign

This commit is contained in:
Justin 2023-08-23 00:42:46 +08:00 committed by GitHub
parent 3920578668
commit 362efd041a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ time_colors = {
"Gray": graphics.Color(100,100,100),
"Cyan": graphics.Color(0,255,255)
}
colon_visible = False
while True:
canvas.Clear()
@ -61,6 +61,13 @@ while True:
current_time = datetime.now(timezone).strftime("%H:%M %p")
else:
current_time = datetime.now(timezone).strftime("%H:%M")
if colon_visible:
current_time = current_time.replace(":", " ")
colon_visible = False
else:
colon_visible = True
current_date = datetime.now(timezone).strftime("%a %d %b %Y")
date_width = graphics.DrawText(canvas, font, 0, 0, time_colors[settings['date_color']], current_date.upper())