Skip to content

Commit a62c74f

Browse files
authored
Draw background around text to make it more visible on dark backgrounds
1 parent a488e7c commit a62c74f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/bigclkinfo/app.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ let clockInfoMenu = clock_info.addInteractive(clockInfoItems, {
4747
trim : true // optional: trim to the specified height, add '...'
4848
}); // TODO: g.findFont returns max size 28px. Would be nice with bigger font if there's room.
4949
//print(foundFontText);
50-
g.setFont(foundFontText.font).setFontAlign(0,1).drawString(foundFontText.text, midx,options.y+165); // draw the text
50+
g.setFont(foundFontText.font).setFontAlign(0,1);
51+
let y = options.y+165;
52+
// draw the text with a background
53+
g.setColor(g.theme.bg).drawString(foundFontText.text, midx-2, y)
54+
.drawString(foundFontText.text, midx+2, y)
55+
.drawString(foundFontText.text, midx, y-2)
56+
.drawString(foundFontText.text, midx, y+2);
57+
g.setColor(g.theme.fg).drawString(foundFontText.text, midx, y);
5158
}
5259
});
5360
Bangle.on("lock", function(locked) {

0 commit comments

Comments
 (0)