vadviktor/bullettrain-go-core

Segment separators and colours

Closed this issue · 2 comments

Right now, my biggest design problem is: how to automate the separator colours at the end of the segments so they are properly coloured. Also how to be able to configure them through env variables, plain strings, whereas they are now types in Go. We'd need a system there that is not complicated. We can change 3rd party colour library or even write our own colouring system.

Any ideas and PRs are welcome.

I have an idea and is linked to Issue #2 :
the segment list have indexes, through those indexes the separators could access the previous segment's colours, then flip them and use their colours. Also separators should be able to check the next segment and decide if they are the last segment and colour appropriately.

Time to implement! :)

Try to use https://github.com/mgutz/ansi instead of the current colour lib, this one looks to support better what we are trying to achieve. It uses strings to identify colours already which solves some of our problems.