I've changed the color output functions write_sgr to have only one color output mode. For 256 color-mode the background-color (when set to TB_DEFAULT) was emitting "\033[48;5;0m". When the actual background of your terminal isn't black it could interfere with the background-colors.
Also moving the switch-case from send_attr to write_sgr makes further maintenance on this behavior better instead of having the same switch-case twice in the same file. Also checking for TB_DEFAULT in write_sgr allows removal of the _bg and _fg functions.
See the following pictures. On the right is before my change, on the left includes my change. My small program writes 'x' to the screen with bg set to TB_DEFAULT and fg iterating over the colors.
Hi,
I've changed the color output functions write_sgr to have only one color output mode. For 256 color-mode the background-color (when set to TB_DEFAULT) was emitting "\033[48;5;0m". When the actual background of your terminal isn't black it could interfere with the background-colors.
Also moving the switch-case from send_attr to write_sgr makes further maintenance on this behavior better instead of having the same switch-case twice in the same file. Also checking for TB_DEFAULT in write_sgr allows removal of the _bg and _fg functions.
See the following pictures. On the right is before my change, on the left includes my change. My small program writes 'x' to the screen with bg set to TB_DEFAULT and fg iterating over the colors.
Kind regards,
Rik