Add multiple color schemes and key bindings to change them

This commits adds these color schemes:

- the default (dark) st color scheme
- the default (dark) alacritty color scheme
- One Half (dark & light)
- Solarized (dark & light)
- Gruvbox (dark & light)

Select one with Alt+1..8.
Select the next one with Alt+0.
Select the previous one with Ctrl+Alt+0.
This commit is contained in:
Max Schillinger
2022-06-23 21:58:37 +02:00
committed by Łukasz Pankowski
parent 3a6d6d7401
commit 01b6343666
4 changed files with 157 additions and 31 deletions

22
st.c
View File

@ -2171,6 +2171,28 @@ tstrsequence(uchar c)
term.esc |= ESC_STR;
}
void
tupdatebgcolor(int oldbg, int newbg)
{
for (int y = 0; y < term.row; y++) {
for (int x = 0; x < term.col; x++) {
if (term.line[y][x].bg == oldbg)
term.line[y][x].bg = newbg;
}
}
}
void
tupdatefgcolor(int oldfg, int newfg)
{
for (int y = 0; y < term.row; y++) {
for (int x = 0; x < term.col; x++) {
if (term.line[y][x].fg == oldfg)
term.line[y][x].fg = newfg;
}
}
}
void
tcontrolcode(uchar ascii)
{