~rockorager/tcell-ansi

Convert tcell to ansi strings, and vice versa

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~rockorager/tcell-ansi
read/write
git@git.sr.ht:~rockorager/tcell-ansi

You can also use your local clone with git send-email.

#tcell-ansi

turn your tcells into ansi strings

#Usage

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))
}