~rockorager/tcell-ansi

91d4320a30b513ed54ade3a529b9d6fc85d37feb — Tim Culverhouse 1 year, 5 months ago 1ca2863 main
readme: add readme

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
1 files changed, 23 insertions(+), 0 deletions(-)

A README.md
A README.md => README.md +23 -0
@@ 0,0 1,23 @@
# tcell-ansi

turn your tcells into ansi strings

## Usage

```go
package main

import "git.sr.ht/~rockorager/tcell-ansi"

func main() {
	// Make a tcell.Style
	mystyle := tcell.StyleDefault.Foreground(tcell.ColorPink)
	// Apply it to your string
	pink := ansi.ApplyStyle(mystyle, "this is pink")
	// Make another style
	bluestyle := tcell.StyleDefault.Foreground(tcell.ColorBlue)
	// Apply it to another string, and maybe the other styled string. Print
	// it and rejoice that you have blue and pink text
	fmt.Println(ansi.ApplyStyle(bluestyle, "this is blue. " + pink))
}
```