From cb7e9354af3cd6246bd793cc3c066126981537db Mon Sep 17 00:00:00 2001 From: Raheman Vaiya Date: Sun, 26 Dec 2021 18:57:04 +0100 Subject: Add support for OSC color sequences --- x.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'x.c') diff --git a/x.c b/x.c index 0385674..6672d7c 100644 --- a/x.c +++ b/x.c @@ -802,6 +802,19 @@ xloadcols(void) loaded = 1; } +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) { -- cgit v1.2.3