51 lines
1.3 KiB
TypeScript
Executable File
51 lines
1.3 KiB
TypeScript
Executable File
#!/usr/bin/env runts -- --allow-import
|
|
|
|
import {term} from "https://script.hatter.ink/@32/deno-commons-mod.ts";
|
|
|
|
function printColors(colors: string[], prefix: string, suffix: string) {
|
|
const termOutputs: string[] = [];
|
|
for (const color of colors) {
|
|
termOutputs.push(
|
|
term.auto(
|
|
`[${prefix}${color}${suffix}][[[[${prefix}${color}${suffix}] Hello World! [/${prefix}${color}${suffix}]]]][/] `,
|
|
),
|
|
);
|
|
}
|
|
console.log(termOutputs.join(" "));
|
|
}
|
|
|
|
async function main() {
|
|
const colors: string[] = [
|
|
"black",
|
|
"red",
|
|
"green",
|
|
"yellow",
|
|
"blue",
|
|
"pink",
|
|
"cyan",
|
|
"white",
|
|
];
|
|
printColors(colors, "", "");
|
|
console.log();
|
|
printColors(colors, "", "_bright");
|
|
console.log();
|
|
printColors(colors, "bg_", "");
|
|
console.log();
|
|
printColors(colors, "bg_", "_bright");
|
|
console.log();
|
|
console.log(
|
|
term.auto(
|
|
"[bg_black][white][bold]Bold, white and black background [/][/][/]",
|
|
),
|
|
);
|
|
console.log(
|
|
term.auto(
|
|
"[black][bg_white][bold]Bold, black and white background [/][/][/]",
|
|
),
|
|
);
|
|
}
|
|
await main();
|
|
|
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260208T144919+08:00.MEYCIQCSlSgTG6QYjn33Q5EH
|
|
// mGh2Fgzhn6QZVFCSKSJYcJrvxwIhAJeu9a64omxuy3aSMLggr7aWnTpDNNWq1dIM8qvjFNQ9
|