aboutsummaryrefslogtreecommitdiffstats
path: root/x.c
diff options
context:
space:
mode:
authorRaheman Vaiya <r.vaiya@gmail.com>2021-12-26 18:57:04 +0100
committerRomain Gonçalves <me@rgoncalves.se>2024-05-12 21:20:50 +0200
commit5dceed2bfa9c57c9e230b86e3834f7cba89bb0d1 (patch)
treef90baa6a48e28db70ef9e41bde7220a73efaf8f5 /x.c
parent7ad409ac2e8d4e9f9cae5f6984f7121cae292b14 (diff)
downloadst-5dceed2bfa9c57c9e230b86e3834f7cba89bb0d1.tar.gz
Add support for OSC color sequences
Diffstat (limited to 'x.c')
-rw-r--r--x.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/x.c b/x.c
index fb38406..12008ef 100644
--- a/x.c
+++ b/x.c
@@ -803,6 +803,19 @@ xloadcols(void)
}
int
+xgetcolor(int x, unsigned char *r, unsigned char *g, unsigned char *b)
+{
+ if (!BETWEEN(x, 0, dc.collen))
+ return 1;
+
+ *r = dc.col[x].color.red >> 8;
+ *g = dc.col[x].color.green >> 8;
+ *b = dc.col[x].color.blue >> 8;
+
+ return 0;
+}
+
+int
xsetcolorname(int x, const char *name)
{
Color ncolor;
remember that computers suck.