aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-19 09:12:45 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-19 09:12:45 +0000
commit10765687db1e882c9f65b90eb2fa423e8bf5ff18 (patch)
tree0e977169ef9f11f626460da5c1ca1cc668e84224 /csi.c
parentgrid: erase: memset() the entire range in one call (diff)
csi: dummy implementation of bright foreground/background colors
Re-use the regular colors for now
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index b6f51ffb..d151f8ce 100644
--- a/csi.c
+++ b/csi.c
@@ -50,6 +50,7 @@ csi_sgr(struct terminal *term)
case 28: term->vt.attrs.conceal = false; break;
case 29: term->vt.attrs.strikethrough = false; break;
+ /* Regular foreground colors */
case 30: term->vt.attrs.foreground = 0x000000ff; break;
case 31: term->vt.attrs.foreground = 0xff0000ff; break;
case 32: term->vt.attrs.foreground = 0x00ff00ff; break;
@@ -60,6 +61,7 @@ csi_sgr(struct terminal *term)
case 37: term->vt.attrs.foreground = 0xffffffff; break;
case 39: term->vt.attrs.foreground = term->grid.foreground; break;
+ /* Regular background colors */
case 40: term->vt.attrs.background = 0x000000ff; break;
case 41: term->vt.attrs.background = 0xff0000ff; break;
case 42: term->vt.attrs.background = 0x00ff00ff; break;
@@ -70,6 +72,28 @@ csi_sgr(struct terminal *term)
case 47: term->vt.attrs.background = 0xffffffff; break;
case 49: term->vt.attrs.background = term->grid.background; break;
+ /* Bright foreground colors */
+ /* TODO: using regular colors for now */
+ case 90: term->vt.attrs.foreground = 0x000000ff; break;
+ case 91: term->vt.attrs.foreground = 0xff0000ff; break;
+ case 92: term->vt.attrs.foreground = 0x00ff00ff; break;
+ case 93: term->vt.attrs.foreground = 0xf0f000ff; break;
+ case 94: term->vt.attrs.foreground = 0x0000ffff; break;
+ case 95: term->vt.attrs.foreground = 0xf000f0ff; break;
+ case 96: term->vt.attrs.foreground = 0x00f0f0ff; break;
+ case 97: term->vt.attrs.foreground = 0xffffffff; break;
+
+ /* Regular background colors */
+ /* TODO: using regular colors for now */
+ case 100: term->vt.attrs.background = 0x000000ff; break;
+ case 101: term->vt.attrs.background = 0xff0000ff; break;
+ case 102: term->vt.attrs.background = 0x00ff00ff; break;
+ case 103: term->vt.attrs.background = 0xf0f000ff; break;
+ case 104: term->vt.attrs.background = 0x0000ffff; break;
+ case 105: term->vt.attrs.background = 0xf000f0ff; break;
+ case 106: term->vt.attrs.background = 0x00f0f0ff; break;
+ case 107: term->vt.attrs.background = 0xffffffff; break;
+
default:
LOG_ERR("unimplemented: CSI: SGR: %u", term->vt.params.v[i].value);
return false;