From 884f9cde6d0e59194a30bee9ffb705ff01adb147 Mon Sep 17 00:00:00 2001 From: Giovanni Campeol Date: Sat, 15 Apr 2023 20:18:33 +0200 Subject: [PATCH] changed colors --- src/colors.ts | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/src/colors.ts b/src/colors.ts index 54898c5..087dcfe 100644 --- a/src/colors.ts +++ b/src/colors.ts @@ -1,32 +1,31 @@ export const COLORS = { - FgBlack: (text: string) => editString(text, "\x1b[30m"), - FgRed: (text: string) => editString(text, "\x1b[31m"), - FgGreen: (text: string) => editString(text, "\x1b[32m"), - FgYellow: (text: string) => editString(text, "\x1b[33m"), - FgBlue: (text: string) => editString(text, "\x1b[34m"), - FgMagenta: (text: string) => editString(text, "\x1b[35m"), - FgCyan: (text: string) => editString(text, "\x1b[36m"), - FgWhite: (text: string) => editString(text, "\x1b[37m"), - FgLightGrey: (text: string) => editString(text, "\x1b[90m"), + FgBlack: (text: string) => modString(text, "\x1b[30m"), + FgRed: (text: string) => modString(text, "\x1b[31m"), + FgGreen: (text: string) => modString(text, "\x1b[32m"), + FgYellow: (text: string) => modString(text, "\x1b[33m"), + FgBlue: (text: string) => modString(text, "\x1b[34m"), + FgMagenta: (text: string) => modString(text, "\x1b[35m"), + FgCyan: (text: string) => modString(text, "\x1b[36m"), + FgWhite: (text: string) => modString(text, "\x1b[37m"), + FgLightGrey: (text: string) => modString(text, "\x1b[90m"), - BgBlack: (text: string) => editString(text, "\x1b[40m"), - BgRed: (text: string) => editString(text, "\x1b[41m"), - BgGreen: (text: string) => editString(text, "\x1b[42m"), - BgYellow: (text: string) => editString(text, "\x1b[43m"), - BgBlue: (text: string) => editString(text, "\x1b[44m"), - BgMagenta: (text: string) => editString(text, "\x1b[45m"), - BgCyan: (text: string) => editString(text, "\x1b[46m"), - BgWhite: (text: string) => editString(text, "\x1b[47m"), - - Bright: (text: string) => editString(text, "\x1b[1m"), - Dim: (text: string) => editString(text, "\x1b[2m"), - Underscore: (text: string) => editString(text, "\x1b[4m"), - Blink: (text: string) => editString(text, "\x1b[5m"), - Reverse: (text: string) => editString(text, "\x1b[7m"), - Hidden: (text: string) => editString(text, "\x1b[8m"), + BgBlack: (text: string) => modString(text, "\x1b[40m"), + BgRed: (text: string) => modString(text, "\x1b[41m"), + BgGreen: (text: string) => modString(text, "\x1b[42m"), + BgYellow: (text: string) => modString(text, "\x1b[43m"), + BgBlue: (text: string) => modString(text, "\x1b[44m"), + BgMagenta: (text: string) => modString(text, "\x1b[45m"), + BgCyan: (text: string) => modString(text, "\x1b[46m"), + BgWhite: (text: string) => modString(text, "\x1b[47m"), + Bright: (text: string) => modString(text, "\x1b[1m"), + Dim: (text: string) => modString(text, "\x1b[2m"), + Underscore: (text: string) => modString(text, "\x1b[4m"), + Blink: (text: string) => modString(text, "\x1b[5m"), + Reverse: (text: string) => modString(text, "\x1b[7m"), + Hidden: (text: string) => modString(text, "\x1b[8m") } -function editString(string: string, code: string) { - return code + string + `\x1b[0m` +function modString(string: string, modder: string) { + return modder + string + `\x1b[0m` } \ No newline at end of file