-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
color_test.go
56 lines (47 loc) · 1.05 KB
/
color_test.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
49
50
51
52
53
54
55
56
package pio
import (
"fmt"
)
func ExampleRich() {
fmt.Println(Rich("black", Black))
fmt.Println(Rich("cyan", Cyan))
fmt.Println(Rich("background cyan",
Cyan,
Background,
))
fmt.Println(Rich("bright yellow",
Yellow,
Bright,
))
fmt.Println(Rich("bright bold magenta",
Magenta,
Bright,
Bold,
))
fmt.Println(Rich("bold cyan",
Cyan,
Bold,
))
fmt.Println(Rich("bold underline reversed bright cyan",
Cyan,
Bright,
Bold,
Underline,
Reversed,
))
fmt.Println(Rich("extended 256-color custom color: 153 (blue-ish)", 153))
fmt.Println(Rich("extended 256-color custom bright reversed color: 153 (blue-ish)", 153,
Bright,
Reversed,
))
// Output:
// [30mblack[0m
// [36mcyan[0m
// [46mbackground cyan[0m
// [33;1mbright yellow[0m
// [35;1m[1mbright bold magenta[0m
// [36m[1mbold cyan[0m
// [36;1m[7m[4m[1mbold underline reversed bright cyan[0m
// [38;5;153mextended 256-color custom color: 153 (blue-ish)[0m
// [38;5;153;1m[7mextended 256-color custom bright reversed color: 153 (blue-ish)[0m
}