hs2-last-updated: added white 2px outline

This commit is contained in:
mehbark 2023-10-25 18:52:46 -04:00
parent 1ae519267e
commit 52f6b02395

View file

@ -118,7 +118,21 @@ const font = await fetch("https://static.pyrope.net/courier-std-bold.otf")
function make_image(n: number): Image {
const days = Math.floor(n).toString().padStart(3, "0");
const image = new Image(106, 44);
let image = new Image(110, 44);
const outline = Image.renderText(
font,
64,
days,
0xff_ff_ff_ff,
new TextLayout({ verticalAlign: "center", horizontalAlign: "middle" }),
);
for (const hshift of [-2, 0, 2]) {
for (const vshift of [-2, 0, 2]) {
image = image.composite(outline, hshift - 4, vshift);
}
}
const text = Image.renderText(
font,
64,
@ -127,7 +141,7 @@ function make_image(n: number): Image {
new TextLayout({ verticalAlign: "center", horizontalAlign: "middle" }),
);
return image.composite(text, -5);
return image.composite(text, -4);
}
async function update_images() {