Closed colecrouter closed 3 years ago
Well "complex runes" are supported, for example it's ok to pass string with emoji if that makes sense. Color codes can be added by means of decorators. I don't plan to change default bar filler, but don't mind having an alternative implementation.
PR is welcome!
I'm not sure I understand, could you give an example? I'd be more than happy to fork (as soon as I get a spare minute hahaha).
Following patch will make bar red.
diff --git a/_examples/singleBar/main.go b/_examples/singleBar/main.go
index f0ba8ea..20c8675 100644
--- a/_examples/singleBar/main.go
+++ b/_examples/singleBar/main.go
@@ -25,8 +25,12 @@ func main() {
decor.OnComplete(
decor.AverageETA(decor.ET_STYLE_GO, decor.WC{W: 4}), "done",
),
+ decor.Name("\x1b[31m"),
+ ),
+ mpb.AppendDecorators(
+ decor.Name("\x1b[0m"),
+ decor.Percentage(),
),
- mpb.AppendDecorators(decor.Percentage()),
)
// simulating some work
max := 100 * time.Millisecond
Ah thank you, I see what you mean. I'll see what I can do.
Check out #88 :P
@Mexican-Man Thanks for your contribution and idea.
I've implemented this feature in v7, see related example.
Suggestion: Allowing
Filler
s to have assignable strings instead of runes. This would allow users to insert colour codes, complex shapes, and more.Instead of having:
we could do something like this: