Fix truecolor escapes, when both bg and fg are set

for example
echo -e "\e[48;2;255;0;0m\e[38;2;0;0;255m test "
should render on red bg with blue fg

also now elinks works correctly when using 'truecolor' option
in preferences

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
This commit is contained in:
Amadeusz Sławiński 2014-01-03 15:24:24 +01:00 committed by Roberto E. Vargas Caballero
parent e8dba89164
commit 9df9a4723d

2
st.c
View file

@ -3083,6 +3083,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
base.fg = defaultunderline; base.fg = defaultunderline;
} }
if(IS_TRUECOL(base.fg)) { if(IS_TRUECOL(base.fg)) {
colfg.alpha = 0xffff;
colfg.red = TRUERED(base.fg); colfg.red = TRUERED(base.fg);
colfg.green = TRUEGREEN(base.fg); colfg.green = TRUEGREEN(base.fg);
colfg.blue = TRUEBLUE(base.fg); colfg.blue = TRUEBLUE(base.fg);
@ -3093,6 +3094,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
} }
if(IS_TRUECOL(base.bg)) { if(IS_TRUECOL(base.bg)) {
colbg.alpha = 0xffff;
colbg.green = TRUEGREEN(base.bg); colbg.green = TRUEGREEN(base.bg);
colbg.red = TRUERED(base.bg); colbg.red = TRUERED(base.bg);
colbg.blue = TRUEBLUE(base.bg); colbg.blue = TRUEBLUE(base.bg);