The line print!("\x1b[38;2;{};{};{};48m{}\x1b[0m", fg.0, fg.1, fg.2, c); includes 48m. From wikipedia the 48 code needs to be followed by either ;5;n where n is a color code or ;2;r;g;b with rgb values as you have done in colored_print_with_background. It looks like a trailing 48m just results in a black background by default in at least KDE's Konsole terminal. This PR just removes the trailing 48.
The line
print!("\x1b[38;2;{};{};{};48m{}\x1b[0m", fg.0, fg.1, fg.2, c);
includes48m
. From wikipedia the48
code needs to be followed by either;5;n
wheren
is a color code or;2;r;g;b
with rgb values as you have done incolored_print_with_background
. It looks like a trailing48m
just results in a black background by default in at least KDE's Konsole terminal. This PR just removes the trailing 48.