deal with the TODO, alphas can now be configured individually again

This commit is contained in:
speedie 2023-04-17 15:26:22 +02:00
parent f2fbc4bbfa
commit 3474193a43
2 changed files with 58 additions and 35 deletions

View file

@ -12,37 +12,34 @@ init_appearance(void)
char cbuf[8];
// set alpha
// TODO: allow these to be individually set, instead of all using fg/bgalpha
alphas[SchemeLArrow][ColFg] = fgalpha;
alphas[SchemeLArrow][ColBg] = bgalpha;
alphas[SchemeRArrow][ColFg] = fgalpha;
alphas[SchemeRArrow][ColBg] = bgalpha;
alphas[SchemeItemNorm][ColFg] = fgalpha;
alphas[SchemeItemNorm][ColBg] = bgalpha;
alphas[SchemeItemSel][ColFg] = fgalpha;
alphas[SchemeItemSel][ColBg] = bgalpha;
alphas[SchemeItemNormPri][ColFg] = fgalpha;
alphas[SchemeItemNormPri][ColBg] = bgalpha;
alphas[SchemeItemSelPri][ColFg] = fgalpha;
alphas[SchemeItemSelPri][ColBg] = bgalpha;
alphas[SchemeMenu][ColBg] = bgalpha;
alphas[SchemeMenu][ColFg] = fgalpha; // this one isn't actually used
alphas[SchemeInput][ColFg] = fgalpha;
alphas[SchemeInput][ColBg] = bgalpha;
alphas[SchemePrompt][ColFg] = fgalpha;
alphas[SchemePrompt][ColBg] = bgalpha;
alphas[SchemeNormHighlight][ColFg] = fgalpha;
alphas[SchemeNormHighlight][ColBg] = bgalpha;
alphas[SchemeSelHighlight][ColFg] = fgalpha;
alphas[SchemeSelHighlight][ColBg] = bgalpha;
alphas[SchemeCaret][ColFg] = fgalpha;
alphas[SchemeCaret][ColBg] = bgalpha;
alphas[SchemeNumber][ColFg] = fgalpha;
alphas[SchemeNumber][ColBg] = bgalpha;
alphas[SchemeMode][ColFg] = fgalpha;
alphas[SchemeMode][ColBg] = bgalpha;
alphas[SchemeBorder][ColFg] = fgalpha; // this one isn't actually used
alphas[SchemeBorder][ColBg] = bgalpha;
alphas[SchemeLArrow][ColFg] = alpha_larrowfg;
alphas[SchemeLArrow][ColBg] = alpha_larrowbg;
alphas[SchemeRArrow][ColFg] = alpha_rarrowfg;
alphas[SchemeRArrow][ColBg] = alpha_rarrowbg;
alphas[SchemeItemNorm][ColFg] = alpha_itemnormfg;
alphas[SchemeItemNorm][ColBg] = alpha_itemnormbg;
alphas[SchemeItemSel][ColFg] = alpha_itemselfg;
alphas[SchemeItemSel][ColBg] = alpha_itemselbg;
alphas[SchemeItemNormPri][ColFg] = alpha_itemnormprifg;
alphas[SchemeItemNormPri][ColBg] = alpha_itemnormpribg;
alphas[SchemeItemSelPri][ColFg] = alpha_itemselprifg;
alphas[SchemeItemSelPri][ColBg] = alpha_itemselpribg;
alphas[SchemeMenu][ColBg] = alpha_menubg;
alphas[SchemeInput][ColFg] = alpha_inputfg;
alphas[SchemeInput][ColBg] = alpha_inputbg;
alphas[SchemePrompt][ColFg] = alpha_promptfg;
alphas[SchemePrompt][ColBg] = alpha_promptbg;
alphas[SchemeNormHighlight][ColFg] = alpha_normhlfg;
alphas[SchemeNormHighlight][ColBg] = alpha_normhlbg;
alphas[SchemeSelHighlight][ColFg] = alpha_selhlfg;
alphas[SchemeSelHighlight][ColBg] = alpha_selhlbg;
alphas[SchemeCaret][ColFg] = alpha_caretfg;
alphas[SchemeCaret][ColBg] = alpha_caretbg;
alphas[SchemeNumber][ColFg] = alpha_numfg;
alphas[SchemeNumber][ColBg] = alpha_numbg;
alphas[SchemeMode][ColFg] = alpha_modefg;
alphas[SchemeMode][ColBg] = alpha_modebg;
alphas[SchemeBorder][ColBg] = alpha_borderbg;
// create color schemes from array
for (j = 0; j < SchemeLast; j++) {

View file

@ -166,6 +166,36 @@ static char col_sgrcolor13[] = "#ff00ff"; /* SGR color #13 */
static char col_sgrcolor14[] = "#00ffff"; /* SGR color #14 */
static char col_sgrcolor15[] = "#ffffff"; /* SGR color #15 */
/* Alpha options */
static int alpha_itemnormfg = opaque; /* Alpha for normal item foreground (0-255) */
static int alpha_itemnormbg = 200; /* Alpha for normal item background (0-255) */
static int alpha_itemselfg = opaque; /* Alpha for selected item foreground (0-255) */
static int alpha_itemselbg = 200; /* Alpha for selected item background (0-255) */
static int alpha_itemnormprifg = opaque; /* alpha for normal priority item foreground (0-255) */
static int alpha_itemnormpribg = 200; /* Alpha for normal priority item background (0-255) */
static int alpha_itemselprifg = opaque; /* Alpha for selected priority item foreground (0-255) */
static int alpha_itemselpribg = 200; /* Alpha for selected priority item background (0-255) */
static int alpha_inputfg = opaque; /* Alpha for input foreground (0-255) */
static int alpha_inputbg = 200; /* Alpha for input background (0-255) */
static int alpha_menubg = 200; /* Alpha for menu background (0-255) */
static int alpha_promptfg = opaque; /* Alpha for prompt foreground (0-255) */
static int alpha_promptbg = 200; /* Alpha for prompt background (0-255) */
static int alpha_larrowfg = opaque; /* Alpha for left arrow foreground (0-255) */
static int alpha_larrowbg = 200; /* Alpha for left arrow background (0-255) */
static int alpha_rarrowfg = opaque; /* Alpha for right arrow foreground (0-255) */
static int alpha_rarrowbg = 200; /* Alpha for right arrow background (0-255) */
static int alpha_normhlfg = opaque; /* Alpha for normal highlight foreground (0-255) */
static int alpha_normhlbg = 200; /* Alpha for normal highlight background (0-255) */
static int alpha_selhlfg = opaque; /* Alpha for selected highlight foreground (0-255) */
static int alpha_selhlbg = 200; /* Alpha for selected highlight background (0-255) */
static int alpha_numfg = opaque; /* Alpha for match count foreground (0-255) */
static int alpha_numbg = 200; /* Alpha for the match count background (0-255) */
static int alpha_borderbg = opaque; /* Alpha for the border (0-255) */
static int alpha_caretfg = opaque; /* Alpha for the caret foreground (0-255) */
static int alpha_caretbg = 200; /* Alpha for the caret background (0-255) */
static int alpha_modefg = opaque; /* Alpha for the mode indicator foreground (0-255) */
static int alpha_modebg = 200; /* Alpha for the mode indicator background (0-255) */
/* Pango options */
static int pango_item = 1; /* Enable support for pango markup for the items */
static int pango_highlight = 1; /* Enable support for pango markup for the highlighting */
@ -177,10 +207,6 @@ static int pango_numbers = 0; /* Enable support for pango markup f
static int pango_mode = 0; /* Enable support for pango markup for the mode indicator */
static int pango_password = 0; /* Enable support for pango markup for the password text */
/* Alpha options */
static int fgalpha = opaque;
static int bgalpha = 200;
/* Misc */
static int coloritems = 1; /* Color items or not */
static char *worddelimiters = " "; /* Word delimiters used for keybinds that change words, " " is default. */