Documentation ¶
Overview ¶
Package style provide display coloring
Index ¶
- Variables
- func ForKeyword(s string) string
- func ForLogLevel(s string) string
- func ForPath(path string) string
- func ForPathExt(path string) string
- func Of(s ...string) string
- func Register(name string, i interface{})
- func SGR(s string) string
- func Set(key, value string) error
- func TrueColor(r, g, b uint8) string
- func XTerm256Color(i uint8) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Default = "" Black = "black" Red = "red" Green = "green" Yellow = "yellow" Blue = "blue" Magenta = "magenta" Cyan = "cyan" White = "white" Gray = Of(Dim, White) BrightBlack = "bright-black" BrightRed = "bright-red" BrightGreen = "bright-green" BrightYellow = "bright-yellow" BrightBlue = "bright-blue" BrightMagenta = "bright-magenta" BrightCyan = "bright-cyan" BrightWhite = "bright-white" BgBlack = "bg-black" BgRed = "bg-red" BgGreen = "bg-green" BgYellow = "bg-yellow" BgBlue = "bg-blue" BgMagenta = "bg-magenta" BgCyan = "bg-cyan" BgWhite = "bg-white" BgBrightBlack = "bg-bright-black" BgBrightRed = "bg-bright-red" BgBrightGreen = "bg-bright-green" BgBrightYellow = "bg-bright-yellow" BgBrightBlue = "bg-bright-blue" BgBrightMagenta = "bg-bright-magenta" BgBrightCyan = "bg-bright-cyan" BgBrightWhite = "bg-bright-white" Bold = "bold" Dim = "dim" Italic = "italic" Underlined = "underlined" Blink = "blink" Inverse = "inverse" )
View Source
var Carapace = carapace{ Value: Default, Description: Gray, Error: Of(Bold, Red), KeywordAmbiguous: Yellow, KeywordNegative: Red, KeywordPositive: Green, KeywordUnknown: Gray, LogLevelTrace: Blue, LogLevelDebug: Gray, LogLevelInfo: Green, LogLevelWarning: Yellow, LogLevelError: Magenta, LogLevelCritical: Red, LogLevelFatal: Cyan, Highlight1: Blue, Highlight2: Yellow, Highlight3: Magenta, Highlight4: Cyan, Highlight5: Green, Highlight6: Of(Blue, Dim), Highlight7: Of(Yellow, Dim), Highlight8: Of(Magenta, Dim), Highlight9: Of(Cyan, Dim), Highlight10: Of(Green, Dim), Highlight11: Bold, Highlight12: Of(Bold, Dim), }
Functions ¶
func ForKeyword ¶ added in v0.19.0
ForKeyword returns the style for given keyword.
func ForLogLevel ¶ added in v0.20.1
ForLogLevel returns the style for given log level.
func ForPathExt ¶ added in v0.19.0
ForPath returns the style for given path by extension only
/tmp/non/existing/file.txt
func Register ¶ added in v0.19.0
func Register(name string, i interface{})
Register a style configuration
var Carapace = struct { Value string `desc:"default style for values"` Description string `desc:"default style for descriptions"` }{ Value: Default, Description: Gray, } func init() { Register("carapace", &Carapace) }
func XTerm256Color ¶ added in v0.18.9
XTerm256Color returns a color from the xterm 256-color palette.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.