package rendering import ( "fmt" ) type FB struct { Foreground string Background string } func Text(text string, fb FB) string { if fb.Foreground == "" { fb.Foreground = Color("default_foreground") } if fb.Background == "" { fb.Background = Color("default_background") } return fmt.Sprintf("%s", fb.Background, fb.Foreground, text) } func TextWithPadding(text string, fb FB) string { return Text(fmt.Sprintf(" %s ", text), fb) } func TextWithLeftPadding(text string, fb FB) string { return Text(fmt.Sprintf(" %s", text), fb) } func TextWithRightPadding(text string, fb FB) string { return Text(fmt.Sprintf("%s ", text), fb) }