upd readme

This commit is contained in:
xdrm-brackets 2019-01-25 12:22:21 +01:00
parent d92b8977b8
commit 8e14182645
1 changed files with 23 additions and 0 deletions

View File

@ -22,9 +22,19 @@ ${<target text>}(<fg>:<bg>)
```
- `<target text>` is the text that will be colorized.
- `<fg>` is the name of the foreground color (*c.f. [color list](https://git.xdrm.io/go/clifmt/src/master/colors.go#L15)*), or an hex color (*e.g.`#00ffaa`, `#0fa`*).
- `<bg>` is the name of the background color with the same syntax as for the foreground.
###### Example
```go
clifmt.Printf("normal text ${red text over black}(red:#000) normal text")
```
> Note that it is not recommended to nest the different coloring formats.
@ -40,6 +50,13 @@ ${<target text>}(<fg>)
###### Example
```go
clifmt.Printf("normal text ${red text}(red) normal text")
```
##### Background only
```go
@ -51,6 +68,12 @@ ${<target text>}(:<bg>)
###### Example
```go
clifmt.Printf("normal text ${text over red}(#ff0000) normal text")
```
----