Skip to content

Commit d64a8e4

Browse files
author
i582
committed
update readme.md
1 parent 1da45c7 commit d64a8e4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ cfmt.Println("This is a {{red color}}::code|bold")
9292

9393
![](doc/example4.svg)
9494

95+
Also you can do whatever you want with the text, which is styled.
96+
97+
```go
98+
cfmt.RegisterStyle("flag", func(s string) string {
99+
return cfmt.Sprintf("{{--%s}}::green (-%c)", s, s[0])
100+
})
101+
```
102+
103+
```go
104+
flag := "help"
105+
cfmt.Println("{{%s}}::flag ", flag)
106+
```
107+
108+
![](doc/example8.svg)
109+
95110
### HEX colors
96111

97112
If the standard colors are not enough for you, then you can use the colors in the Hex format (note, not all consoles support all colors fully!).

0 commit comments

Comments
 (0)