0
0
Fork 0
deno_monorepo/net/irc/formatting.ts

53 lines
817 B
TypeScript

/**
* @file
* @copyright 2020, Valentin Anger
* @license ISC
*/
export function bold(): string {
return "\x02";
}
export function color(
foreground: Color = Color.Default,
background: Color = Color.Default,
): string {
return `\x03${foreground},${background}`;
}
export function italic(): string {
return "\x1d";
}
export function reset(): string {
return "\x0f";
}
export function strikethrough(): string {
return "\x1e";
}
export function underline(): string {
return "\x1f";
}
export enum Color {
White = "00",
Black = "01",
Blue = "02",
Green = "03",
Red = "04",
Brown = "05",
Purple = "06",
Orange = "07",
Yellow = "08",
LightGreen = "09",
Teal = "10",
LightCyan = "11",
LightBlue = "12",
Pink = "13",
Gray = "14",
LightGray = "15",
Default = "99",
}