aboutsummaryrefslogtreecommitdiff
path: root/style.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-02-22 20:48:44 +0000
committerThomas Adam <thomas@xteddy.org>2014-02-22 20:48:44 +0000
commit150ef868008385a79278a5a3d16169c16b2d880a (patch)
tree24d801ee28a847e0f2f1592b82c36488c7d0fb91 /style.c
parent2a412fad044e402391a1c82dc600ce03c7ce2bc5 (diff)
parent315d45a0eb596048f2513dab98e4bb47ec1852a4 (diff)
downloadrtmux-150ef868008385a79278a5a3d16169c16b2d880a.tar.gz
rtmux-150ef868008385a79278a5a3d16169c16b2d880a.tar.bz2
rtmux-150ef868008385a79278a5a3d16169c16b2d880a.zip
Merge branch 'obsd-master'
Diffstat (limited to 'style.c')
-rw-r--r--style.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/style.c b/style.c
index 97d5576e..99744086 100644
--- a/style.c
+++ b/style.c
@@ -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;
}