package style
import (
"strings"
"github.com/carapace-sh/carapace/third_party/github.com/elves/elvish/pkg/ui"
)
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"
)
func Of (s ...string ) string { return strings .TrimSpace (strings .Join (s , " " )) }
func XTerm256Color (i uint8 ) string { return ui .XTerm256Color (i ).String () }
func TrueColor (r , g , b uint8 ) string { return ui .TrueColor (r , g , b ).String () }
func SGR (s string ) string { return Parse (s ).SGR () }
func Parse (s string ) ui .Style {
stylings := make ([]ui .Styling , 0 )
for _ , word := range strings .Split (s , " " ) {
if styling := ui .ParseStyling (word ); styling != nil {
stylings = append (stylings , styling )
}
}
return ui .ApplyStyling (ui .Style {}, stylings ...)
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .