File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11package cmd
22
3- import "github.com/charmbracelet/lipgloss"
3+ import (
4+ "github.com/charmbracelet/lipgloss"
5+ "regexp"
6+ )
47
58// This file holds all lipgloss stylization variables in one spot since they
69// are used throughout the package and don't need to be redeclared.
710var (
11+ green = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#38B000" ))
12+ red = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#D00000" ))
13+ gray = lipgloss .Color ("#777777" )
14+ keyMenu = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#777777" ))
815 errorColor = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#F2055C" ))
916 errorBorder = lipgloss .NewStyle ().
1017 BorderStyle (lipgloss .RoundedBorder ()).
@@ -45,3 +52,9 @@ func getTypeColor(typeName string) string {
4552
4653 return color
4754}
55+
56+ // stripANSI function is used in tests to strip ANSI for plain text processing
57+ func stripANSI (input string ) string {
58+ ansiRegex := regexp .MustCompile (`\x1b\[[0-9;]*m` )
59+ return ansiRegex .ReplaceAllString (input , "" )
60+ }
You can’t perform that action at this time.
0 commit comments