-
Notifications
You must be signed in to change notification settings - Fork 897
fix: use ANSI colors codes instead of RGB #14665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5e308df
86175bf
098d35d
3d13060
5b8fa3b
4ce84a4
a75dbb2
390a7ca
7e6db79
ce913a5
22a2d0b
5e42118
40eb24e
ccf174a
1fbef1d
44c3726
d16f625
1babe96
ff3c392
6d93c56
506aa28
997dc43
24a838d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,13 @@ var ( | |
) | ||
|
||
var ( | ||
Red = Color("1") | ||
Green = Color("2") | ||
Yellow = Color("3") | ||
Blue = Color("4") | ||
Magenta = Color("5") | ||
White = Color("7") | ||
BrightMagenta = Color("13") | ||
red = Color("1") | ||
green = Color("2") | ||
yellow = Color("3") | ||
blue = Color("4") | ||
magenta = Color("5") | ||
white = Color("7") | ||
brightMagenta = Color("13") | ||
) | ||
|
||
// Color returns a color for the given string. | ||
|
@@ -126,11 +126,11 @@ func Field(s string) string { | |
return pretty.Sprint(DefaultStyles.Field, s) | ||
} | ||
|
||
func ifTerm(fmt pretty.Formatter) pretty.Formatter { | ||
func ifTerm(f pretty.Formatter) pretty.Formatter { | ||
if !isTerm() { | ||
return pretty.Nop | ||
} | ||
return fmt | ||
return f | ||
} | ||
|
||
func init() { | ||
|
@@ -144,31 +144,31 @@ func init() { | |
pretty.BgColor(color.Color("#2C2C2C")), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Were there no acceptable ANSI colors to replace these? Why did we go from red to ed567a? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we set both the foreground and background colour, we have complete control over the contrast so this looks the same regardless of the terminal theme. If we want to use an ANSI code instead we can but there isn't a need to here.
|
||
}, | ||
DateTimeStamp: pretty.Style{ | ||
pretty.FgColor(Blue), | ||
pretty.FgColor(blue), | ||
}, | ||
Error: pretty.Style{ | ||
pretty.FgColor(Red), | ||
pretty.FgColor(red), | ||
}, | ||
Field: pretty.Style{ | ||
pretty.XPad(1, 1), | ||
pretty.FgColor(color.Color("#FFFFFF")), | ||
pretty.BgColor(color.Color("#2B2A2A")), | ||
}, | ||
Fuchsia: pretty.Style{ | ||
pretty.FgColor(BrightMagenta), | ||
pretty.FgColor(brightMagenta), | ||
}, | ||
Keyword: pretty.Style{ | ||
pretty.FgColor(Green), | ||
pretty.FgColor(green), | ||
}, | ||
Placeholder: pretty.Style{ | ||
pretty.FgColor(Magenta), | ||
pretty.FgColor(magenta), | ||
}, | ||
Prompt: pretty.Style{ | ||
pretty.FgColor(White), | ||
pretty.FgColor(white), | ||
pretty.Wrap("> ", ""), | ||
}, | ||
Warn: pretty.Style{ | ||
pretty.FgColor(Yellow), | ||
pretty.FgColor(yellow), | ||
}, | ||
Wrap: pretty.Style{ | ||
pretty.LineWrap(80), | ||
|
@@ -177,7 +177,7 @@ func init() { | |
|
||
DefaultStyles.FocusedPrompt = append( | ||
DefaultStyles.Prompt, | ||
pretty.FgColor(Blue), | ||
pretty.FgColor(blue), | ||
) | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍