briandowns/spinner

Question about prefix or suffix color?

wjohnson-metroland opened this issue · 2 comments

This is a question and not really an issue. Is it possible to have the prefix, suffix or FinalMSG printed with color?

For example, I can create a simple spinner and make it bold, yellow:

s := spinner.New(spinner.CharSets[29], 150*time.Millisecond)
s.Color("yellow", "bold")
s.Start()

Works just fine, I see my spinner doing it's thing in bold, yellow.

But if I want to have the prefix or suffix or FinalMSG in color, is it possible? Say for example, cyan?

s.Prefix = "doing stuff... "
s.Suffix = "wrapping up.."
s.FinalMSG = "all done"

I can achieve the same result by manually adding color and not using prefix, suffix or FinalMSG but thought I would ask in case I'm missing something.

I haven't tested this but you can add any string in there with escapes for coloring and they "should" come out as expected. (sorry for the delay in response)

Please feel free to reopen if necessary.