Skip to content
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

codec/text: use 99 for default irc fg color #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions caca/codec/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,7 @@ void *_export_irc(caca_canvas_t const *cv, size_t *bytes)
bg = ansibg < 0x10 ? palette[ansibg] : 0x10;

/* TODO: optimise series of same fg / same bg
* don't change fg value if ch == ' '
* make sure the \x03,%d trick works everywhere */
* don't change fg value if ch == ' ' */
if(bg != prevbg || fg != prevfg)
{
int need_escape = 0;
Expand All @@ -733,7 +732,8 @@ void *_export_irc(caca_canvas_t const *cv, size_t *bytes)
else
{
if(fg == 0x10)
cur += sprintf(cur, "\x0f\x03,%d", bg);
/* fg must be provided; 99 is the default color for a line */
cur += sprintf(cur, "\x0399,%d", bg);
else
cur += sprintf(cur, "\x03%d,%d", fg, bg);
}
Expand Down