-
Notifications
You must be signed in to change notification settings - Fork 13
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
xterm-256color support #17
Comments
Here is an example 256 color ANSI file with CP437 encoding: |
A resource for xterm-256 palette information: https://www.ditig.com/publications/256-colors-cheat-sheet Note that colors 0-15 are not standard. The ones listed there do not match VGA colors. I think they might be the default colors when using classic OG xterm. However, terminals can (and do) set colors 0-15 to however they like, with no real standard. Personally I think it would be fine for colors 0-15 to use the VGA colors instead of the nonstandard xterm default. I am pretty sure this is what the Linux console uses, and this is how I configure my terminals. This also improves standard DOS/CP437 ANSI art compatibility. For now, in my little libansilove fork, I am copying colors 0-15 from Ansilove's VGA palette for use in the 256 color palette, instead of using colors 0-15 from the link above. |
It would be nice for libansilove to support these escape codes for the xterm-256color palette.
Examples of ANSI editors that export ANSI to this format include Durdraw, which also does Ansilove exporting. This would allow Durdraw to export PNG and GIF files in 256 color, instead of just 16 color. This would also allow sites like 16colo.rs to view these files correctly.
I am looking at the source code... I think the trick would be something like:
1: In config.h: Add the xterm-256color palette as 8-bit hex values
2: In ansi.c: Add interpreters for the 256 color escape codes, the palette generator, and any other logic to deal with color values larger than 16.
3: ???
4: profit!
If I get some time I will give it a try, or if someone else wants to. This can probably be considered a duplicate of issue ansilove/ansilove#43.
Thanks!
The text was updated successfully, but these errors were encountered: