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 string = "" Black string = "black" Red string = "red" Green string = "green" Yellow string = "yellow" Blue string = "blue" Magenta string = "magenta" Cyan string = "cyan" White string = "white" Gray string = Of(Dim, White) BrightBlack string = "bright-black" BrightRed string = "bright-red" BrightGreen string = "bright-green" BrightYellow string = "bright-yellow" BrightBlue string = "bright-blue" BrightMagenta string = "bright-magenta" BrightCyan string = "bright-cyan" BrightWhite string = "bright-white" BgBlack string = "bg-black" BgRed string = "bg-red" BgGreen string = "bg-green" BgYellow string = "bg-yellow" BgBlue string = "bg-blue" BgMagenta string = "bg-magenta" BgCyan string = "bg-cyan" BgWhite string = "bg-white" BgBrightBlack string = "bg-bright-black" BgBrightRed string = "bg-bright-red" BgBrightGreen string = "bg-bright-green" BgBrightYellow string = "bg-bright-yellow" BgBrightBlue string = "bg-bright-blue" BgBrightMagenta string = "bg-bright-magenta" BgBrightCyan string = "bg-bright-cyan" BgBrightWhite string = "bg-bright-white" Bold string = "bold" Dim string = "dim" Italic string = "italic" Underlined string = "underlined" Blink string = "blink" Inverse string = "inverse" )
View Source
var Carapace = struct { Value string `desc:"default style for values"` Description string `desc:"default style for descriptions"` KeywordAmbiguous string `desc:"keyword describing a ambiguous state"` KeywordNegative string `desc:"keyword describing a negative state"` KeywordPositive string `desc:"keyword describing a positive state"` KeywordUnknown string `desc:"keyword describing an unknown state"` LogLevelTrace string `desc:"LogLevel TRACE"` LogLevelDebug string `desc:"LogLevel DEBUG"` LogLevelInfo string `desc:"LogLevel INFO"` LogLevelWarning string `desc:"LogLevel WARNING"` LogLevelError string `desc:"LogLevel ERROR"` LogLevelCritical string `desc:"LogLevel CRITICAL"` LogLevelFatal string `desc:"LogLevel FATAL"` }{ Value: Default, Description: Gray, KeywordAmbiguous: Yellow, KeywordNegative: Red, KeywordPositive: Green, KeywordUnknown: Gray, LogLevelTrace: Blue, LogLevelDebug: Gray, LogLevelInfo: Green, LogLevelWarning: Yellow, LogLevelError: Magenta, LogLevelCritical: Red, LogLevelFatal: Cyan, }
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.