Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnsiColorCode ¶
func AnsiColorCode(color textstyle.NamedColor) int
func Formater ¶
Example ¶
package main import ( "fmt" "github.com/muhqu/go-attributedtext/textstyle" "github.com/muhqu/go-attributedtext/textstyle/ansiformater" ) func main() { err := ansiformater.Formater(textstyle.Red.ForegroundColor()) info := ansiformater.Formater(textstyle.Yellow.ForegroundColor()) fatal := ansiformater.Formater(textstyle.Red.ForegroundColor(), textstyle.Bold, textstyle.Underline, textstyle.White.BackgroundColor()) fmt.Printf("%#v\n", err("Hello")) fmt.Printf("%#v\n", info("World")) fmt.Printf("%#v\n", fatal("Fatal!")) }
Output: "\x1b[31mHello\x1b[0m" "\x1b[33mWorld\x1b[0m" "\x1b[1;4;31;47mFatal!\x1b[0m"
Types ¶
Click to show internal directories.
Click to hide internal directories.