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
Some colors are defined in defaultTemplateFuncs, but these are only some of the colors in the color package, how to use more colors quickly?
defaultTemplateFuncs
color
// Foreground text colors const ( FgBlack Attribute = iota + 30 FgRed FgGreen FgYellow FgBlue FgMagenta FgCyan FgWhite ) // Foreground Hi-Intensity text colors const ( FgHiBlack Attribute = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
The text was updated successfully, but these errors were encountered:
You can register a new pb.Element
pb.RegisterElement("myColor", pb.ElementFunc(func(state *pb.State, args ...string) string { for _, arg := range args { return color.New(color.BgHiGreen).Sprint(arg) } return "" }), false) tmpl := `{{counters . | myColor .}} {{bar . }} {{percent . }} {{ myColor . "one" }}` bar := pb.ProgressBarTemplate(tmpl)
Sorry, something went wrong.
No branches or pull requests
Some colors are defined in
defaultTemplateFuncs
, but these are only some of the colors in thecolor
package, how to use more colors quickly?The text was updated successfully, but these errors were encountered: