-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set both background and color? #17
Comments
Hi @jcubic, ANSI escape code support combine color and background, for example: console.log('\x1b[36m\x1b[41mHello World\x1b[0m') I will add new mixin utils function to comine fg and bg styles if it is necessary. |
I know how to do this in raw text using ANSI escapes, the problem is the ervy API. Can I write code that will make both color and background? |
Of course. |
So can I write it? Can you share the code on how to do this? I would update the demo, because it's looks weird when you select text. |
It seems that for ervy.bg in demo the fix would be something like this (using existing API): function bg(style, size) {
var fg = ervy.fg(style, '?').replace(/\?.*/, '');
return fg + ervy.bg(style, size);
} and it will fix selection in a terminal. If you want to can create a PR. You can see how this works in in demo: An alternative is to come up with a better API like Note that the error is not only in the web terminal the same happens in a real terminal emulator. |
I've noticed that the demo doesn't render properly when you select the text. The charts should be reversed.
To fix the issue the style should be both
ervy.bg
andervy.fg
. Is it possible to combine the styles?The text was updated successfully, but these errors were encountered: