Add configurable animation color for CMatrix

Adds a "animation_fg" config variable that is applied to the CMatrix
animation.
It defaults to the current color: green (color 3).
This commit is contained in:
matthias@arch 2023-10-30 15:44:02 +01:00
parent 4ee2b3ecc7
commit 80b59713e5
4 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,9 @@
# Foreground color id
#fg = 9
# Animation color id (applies to CMatrix only)
#animation_fg = 3
# Blank main box background
# Setting to false will make it transparent
#blank_box = true

View File

@ -159,6 +159,7 @@ void config_load(const char *cfg_path)
{
{"animate", &config.animate, config_handle_bool},
{"animation", &config.animation, config_handle_u8},
{"animation_fg", &config.animation_fg, config_handle_u8},
{"asterisk", &config.asterisk, config_handle_char},
{"bg", &config.bg, config_handle_u8},
{"bigclock", &config.bigclock, config_handle_bool},
@ -271,6 +272,7 @@ void config_defaults()
{
config.animate = false;
config.animation = 0;
config.animation_fg = 3;
config.asterisk = '*';
config.bg = 0;
config.bigclock = false;

View File

@ -72,6 +72,7 @@ struct config
char* console_dev;
uint8_t default_input;
uint8_t fg;
uint8_t animation_fg;
bool hide_borders;
bool hide_key_hints;
uint8_t input_len;

View File

@ -922,8 +922,8 @@ static void matrix(struct term_buf* buf)
for (int i = 1; i <= buf->height; ++i)
{
uint32_t c;
int fg = TB_GREEN;
int bg = TB_DEFAULT;
int fg = config.animation_fg;
if (s->grid[i][j].val == -1 || s->grid[i][j].val == ' ')
{