Create curses colour pairs for 256 colours

Keep only 8 background colours but if curses supports 256 colours and
256*8 colours pairs, create colours pairs for 256 foregrounds rather
than just 16.
This commit is contained in:
Doktor L
2026-06-19 16:36:27 +02:00
committed by Patric Mueller
parent 7036f902d2
commit 19c87585fa
4 changed files with 22 additions and 7 deletions
+5 -1
View File
@@ -769,7 +769,11 @@ static int
get_framecolor(int nhcolor, int framecolor)
{
/* curses_toggle_color_attr() adds the +1 and takes care of COLORS < 16 */
return (16 * (framecolor % 8)) + (nhcolor % 16);
if (curses_has_256color()) {
return (256 * (framecolor % 8)) + (nhcolor % 256);
} else
return (16 * (framecolor % 8)) + (nhcolor % 16);
}
static void