We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
You could add a function for Custom coloring
Example:
func CustomColoring(foreground string, background string, s any, bold bool, underline bool) string { b, u := "", "" if bold { b = Bold } if underline { u = Underline } return Colorize(b+u+foreground+background, s) }
Usage:
log.Println(color.CustomColoring(color.White, color.Black, s, false, false)) log.Println(color.CustomColoring(color.White, color.Black, s, true, false)) log.Println(color.CustomColoring(color.White, color.Black, s, false, true)) log.Println(color.CustomColoring(color.Black, color.White, s, true, true))
or
func CustomColoring(foreground string, background string, s any, bold string, underline string) string { return Colorize(bold+underline+foreground+background, s) }
log.Println(color.CustomColoring(color.White, color.Black, s, "", "")) log.Println(color.CustomColoring(color.White, color.Black, s, color.Bold, "")) log.Println(color.CustomColoring(color.White, color.Black, s, "", color.Underline)) log.Println(color.CustomColoring(color.Black, color.White, s, color.Bold, color.Underline))
Result:
I already implemented
one year
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the feature request
You could add a function for Custom coloring
Example:
Usage:
or
Usage:
Result:
Why do you personally want this feature to be implemented?
I already implemented
How long have you been using this project?
one year
Additional information
No response
The text was updated successfully, but these errors were encountered: