Documentation ¶
Overview ¶
Package style provide display coloring
Index ¶
- Variables
- func ForExtension(path string, sc Context) string
- func ForKeyword(s string, _ Context) string
- func ForLogLevel(s string, _ Context) string
- func ForPath(path string, sc Context) string
- func ForPathExt(path string, sc Context) string
- func Of(s ...string) string
- func Parse(s string) ui.Style
- 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
- type Context
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" 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: Dim, Error: Of(Bold, Red), Usage: Dim, KeywordAmbiguous: Yellow, KeywordNegative: Red, KeywordPositive: Green, KeywordUnknown: Of(Dim, White), LogLevelTrace: Blue, LogLevelDebug: Of(Dim, White), LogLevelInfo: Green, LogLevelWarning: Yellow, LogLevelError: Magenta, LogLevelCritical: Red, LogLevelFatal: Cyan, Highlight1: Blue, Highlight2: Yellow, Highlight3: Magenta, Highlight4: Cyan, Highlight5: Green, Highlight6: Of(Dim, Blue), Highlight7: Of(Dim, Yellow), Highlight8: Of(Dim, Magenta), Highlight9: Of(Dim, Cyan), Highlight10: Of(Dim, Green), Highlight11: Bold, Highlight12: Of(Dim, Bold), FlagArg: Blue, FlagMultiArg: Magenta, FlagNoArg: Default, FlagOptArg: Yellow, }
Functions ¶
func ForKeyword ¶
ForKeyword returns the style for given keyword.
func ForLogLevel ¶
ForLogLevel returns the style for given log level.
func ForPathExt ¶
ForPath returns the style for given path by extension only
/tmp/non/existing/file.txt
func Register ¶
func Register(name string, i interface{})
Register a style configuration
var Carapace = struct { Value string `description:"default style for values"` Description string `description:"default style for descriptions"` }{ Value: Default, Description: Gray, } func init() { Register("carapace", &Carapace) }
func XTerm256Color ¶
XTerm256Color returns a color from the xterm 256-color palette.
Types ¶
Click to show internal directories.
Click to hide internal directories.