diff options
author | nicm <nicm> | 2014-02-22 01:38:47 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-02-22 01:38:47 +0000 |
commit | c7f3599ebca82fcd1c2a00de234f90ac1f5f0ede (patch) | |
tree | 2ef3666da2599e3d5983035d5482e6b4955c9294 /style.c | |
parent | 6daf06b1ad61f67e9f7780d787451b9b5f82dd43 (diff) | |
download | rtmux-c7f3599ebca82fcd1c2a00de234f90ac1f5f0ede.tar.gz rtmux-c7f3599ebca82fcd1c2a00de234f90ac1f5f0ede.tar.bz2 rtmux-c7f3599ebca82fcd1c2a00de234f90ac1f5f0ede.zip |
Fix -fg/-bg/-style with 256 colour terminals.
Diffstat (limited to 'style.c')
-rw-r--r-- | style.c | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -203,8 +203,14 @@ style_apply(struct grid_cell *gc, struct options *oo, const char *name) memcpy(gc, &grid_default_cell, sizeof *gc); gcp = options_get_style(oo, name); - colour_set_fg(gc, gcp->fg); - colour_set_bg(gc, gcp->bg); + if (gcp->flags & GRID_FLAG_FG256) + colour_set_fg(gc, gcp->fg | 0x100); + else + colour_set_fg(gc, gcp->fg); + if (gcp->flags & GRID_FLAG_BG256) + colour_set_bg(gc, gcp->bg | 0x100); + else + colour_set_bg(gc, gcp->bg); gc->attr |= gcp->attr; } @@ -215,10 +221,18 @@ style_apply_update(struct grid_cell *gc, struct options *oo, const char *name) struct grid_cell *gcp; gcp = options_get_style(oo, name); - if (gcp->fg != 8) - colour_set_fg(gc, gcp->fg); - if (gcp->bg != 8) - colour_set_bg(gc, gcp->bg); + if (gcp->fg != 8) { + if (gcp->flags & GRID_FLAG_FG256) + colour_set_fg(gc, gcp->fg | 0x100); + else + colour_set_fg(gc, gcp->fg); + } + if (gcp->bg != 8) { + if (gcp->flags & GRID_FLAG_BG256) + colour_set_bg(gc, gcp->bg | 0x100); + else + colour_set_bg(gc, gcp->bg); + } if (gcp->attr != 0) gc->attr |= gcp->attr; } |