16 lines
447 B
TypeScript
Executable file
16 lines
447 B
TypeScript
Executable file
#!./run
|
|
|
|
import { AnsiTerminalDisplay } from "./ansi.ts";
|
|
import { TextUI } from "./ui.ts";
|
|
|
|
const display = new AnsiTerminalDisplay();
|
|
const ui = new TextUI(display);
|
|
await ui.init([
|
|
{ r: 0, g: 0, b: 0 },
|
|
{ r: 1, g: 1, b: 1 },
|
|
{ r: 0, g: 1, b: 1 },
|
|
]);
|
|
ui.drawing.color(2, 0).text("hello", { x: 10, y: 3 });
|
|
ui.drawing.color(0, 1).text("world", { x: 10, y: 5 });
|
|
await ui.flush();
|
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|