From bae1313e9b8ae1309d1c5b660781fd07bb1ee345 Mon Sep 17 00:00:00 2001 From: Shane C Date: Sun, 7 Jul 2024 14:41:35 -0400 Subject: [PATCH] add colors and formatting variable for ansi escape codes --- ansi.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ansi.go diff --git a/ansi.go b/ansi.go new file mode 100644 index 0000000..efd6066 --- /dev/null +++ b/ansi.go @@ -0,0 +1,30 @@ +package tui + +// Formatting +const ( + FmtReset = "\033[0m" + FmtBold = "\033[1m" + FmtBoldReset = "\033[22m" + FmtDim = "\033[2m" + FmtDimReset = FmtBoldReset + FmtItalic = "\033[3m" + FmtItalicReset = "\033[23m" + FmtUnderline = "\033[4m" + FmtUnderlineReset = "\033[24m" + FmtBlink = "\033[5m" + FmtBlinkReset = "\033[25m" + FmtReverse = "\033[7m" + FmtReverseReset = "\033[27m" + FmtHidden = "\033[8m" + FmtHiddenReset = "\033[28m" + FmtStrikethrough = "\033[9m" + FmtStrikethroughReset = "\033[29m" +) + +// Foreground Colors +const ( + FgColorGrey = "\033[38;5;247m" + FgColorGold = "\033[28;5;214m" + FgColorGreen = "\033[38;5;34m" + FgColorRed = "\033[38;5;167m" +)