diff --git a/README.md b/README.md index 0f6e42c..bb46b49 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,19 @@ ${}(:) ``` - `` is the text that will be colorized. + - `` 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`*). + - `` 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 @@ ${}() +###### Example + +```go +clifmt.Printf("normal text ${red text}(red) normal text") +``` + + ##### Background only ```go @@ -51,6 +68,12 @@ ${}(:) +###### Example + +```go +clifmt.Printf("normal text ${text over red}(#ff0000) normal text") +``` + ----