From 8e141826453d3de826bba4937265184d9fb6c549 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 25 Jan 2019 12:22:21 +0100 Subject: [PATCH] upd readme --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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") +``` + ----