-
Notifications
You must be signed in to change notification settings - Fork 1
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
support color256 #5
Conversation
34 | 44 => "blue".into(), | ||
35 | 45 => "magenta".into(), | ||
36 | 46 => "cyan".into(), | ||
37 | 47 => "white".into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a good time to add 39 | 49
which are set to default
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797#8-16-colors
https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
of course it would need to be updated in other places. I can add a new issue if you like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
39 and 49 should be white by default. If you have a specific use case, feel free to open a new issue. This PR is already larger than I expected :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of default is that your terminal knows what text color contrasts well with your background color. So, on light terminals the text is dark and on dark terminals the text is light. I'm not sure exactly how it works because it's not necessarily index 0 (black) or 15 (white) for the color. On Dark Solarized, which has a kind of green background, it chooses a gray color, which is index 10, 11, or 12. I can submit another issue on this subject. Thanks.
This seems to be real close, using the xterm theme, but for some reason default text is black. You can see that the escapes are trying to make it white, but they're showing up black. Also note that the This is the command I used ls | table | ansi2 -f svg --font C:\Users\fdncred\AppData\Local\Microsoft\Windows\Fonts\CascadiaMonoNF.ttf --mode dark --theme xterm | save ls-xterm.svg -f ansi file |
ah, it must be inverting white and black because of --mode dark? |
In dark mode, white and black are swapped, and the terminal implementation is much more complicated. If the font and background colors are similar, the font color will be inverted, which ansi2 does not support |
close: #4 (comment)