Open Xliff opened 1 month ago
Here's a simple splash
example with color:
use Terminal::UI 'ui';
use Terminal::ANSI::OO 't';
ui.setup(:1pane);
ui.pane.splash( [ t.green => 'hello', t.text-reset => 'world' ] );
ui.get-key;
ui.shutdown;
The formatting codes need to be in the keys of the pairs that are sent.
The reason it works this way is because in order to center things horizontally, the text portion is used to compute the indentation.
What if there was a way to pass in the width of the actual text to center?
Would splash still be the best way to do it or would I need another method to add in the raw content?
Hmm, passing the width could remove that requirement I suppose -- but it could take some work -- splash
just uses put
which looks for either text or format => text pairs, so this method would probably need a way to take text that also had escape sequences...things would get unfortunate when callbacks are triggered and the text conatins formatting codes though, so if there's a way to separate them I think that's ideal.
I have colored content I'd like to send to splash, but it is rendering incorrectly.
What would I need to do. There is only color codes in the string I am sending in.
Thanks