hs2-last-updated: added white 2px outline
This commit is contained in:
parent
1ae519267e
commit
52f6b02395
1 changed files with 16 additions and 2 deletions
|
@ -118,7 +118,21 @@ const font = await fetch("https://static.pyrope.net/courier-std-bold.otf")
|
||||||
|
|
||||||
function make_image(n: number): Image {
|
function make_image(n: number): Image {
|
||||||
const days = Math.floor(n).toString().padStart(3, "0");
|
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(
|
const text = Image.renderText(
|
||||||
font,
|
font,
|
||||||
64,
|
64,
|
||||||
|
@ -127,7 +141,7 @@ function make_image(n: number): Image {
|
||||||
new TextLayout({ verticalAlign: "center", horizontalAlign: "middle" }),
|
new TextLayout({ verticalAlign: "center", horizontalAlign: "middle" }),
|
||||||
);
|
);
|
||||||
|
|
||||||
return image.composite(text, -5);
|
return image.composite(text, -4);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function update_images() {
|
async function update_images() {
|
||||||
|
|
Loading…
Reference in a new issue