From ab7ebf787f0ff28c65c4979d305d343082ec5abb Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 3 Jun 2022 12:43:37 +0200 Subject: [PATCH] Add accent colors to the statusbar --- config.h | 4 ++++ patch/bar_status2d.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.h b/config.h index 38ef78b..1e0db44 100644 --- a/config.h +++ b/config.h @@ -65,6 +65,10 @@ static char *termcolor[] = { termcol13, termcol14, termcol15, + accent, + secondary, + background, + foreground, }; static char *colors[][3] = { /* fg bg border */ diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c index cf428f5..3e3cd08 100644 --- a/patch/bar_status2d.c +++ b/patch/bar_status2d.c @@ -80,10 +80,12 @@ drawstatusbar(int x, char* stext) i += 7; } else if (text[i] == 'C') { int c = atoi(text + ++i); - drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c]); + if (c < sizeof(termcolor) / sizeof(*termcolor)) + drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c]); } else if (text[i] == 'B') { int c = atoi(text + ++i); - drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c]); + if (c < sizeof(termcolor) / sizeof(*termcolor)) + drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c]); } else if (text[i] == 'd') { drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];