-
Notifications
You must be signed in to change notification settings - Fork 0
/
complex_phrases.go
48 lines (39 loc) · 1.15 KB
/
complex_phrases.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package examples
import "github.com/go-color-term/go-color-term/coloring"
type ComplexPhrasesExample struct{}
func (example *ComplexPhrasesExample) GetTitle() string {
return "Complex phrases"
}
func (example *ComplexPhrasesExample) GetDescription() string {
return "An example showing the styling of sentence using SentenceBuilder."
}
func (example *ComplexPhrasesExample) Run() {
coloring.Sentence().
Text("This is ").
ColorSet(coloring.GREEN).
Text("some ").
UnderlineStart().
Text("nice").ColorReset().
Text(" way").
UnderlineEnd().
Text(" of writing ").
BoldStart().Color("red", coloring.RED).
Text(" text!!!").
Println()
coloring.Sentence().
BoldStart().StrikethroughStart().
Color("Red", coloring.RED).
Text(", ").
Color("green", coloring.GREEN).
Text(" and ").
Color("yellow", coloring.YELLOW).
StrikethroughEnd().
Text(" all crossed!").
Println()
coloring.Sentence().BoldStart().Invert("BLACK").Text("WHITE").Println()
coloring.Sentence().Blink("Blinking").Println()
coloring.Sentence().BackgroundSet(coloring.BLUE).
Color("This is some text ", coloring.MAGENTA).
Bold("with a bold ending").
Println()
}