From dab269f506389e1ec27a98923b3e7b38d83a6e8f Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 25 Jul 2020 23:11:28 -0400 Subject: [PATCH] tetris: ensure continued color changes #825 --- src/tetris/stain.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tetris/stain.h b/src/tetris/stain.h index fc1d03fd6..aa464ef82 100644 --- a/src/tetris/stain.h +++ b/src/tetris/stain.h @@ -1,12 +1,13 @@ void StainBoard(int dimy, int dimx){ board_->cursor_move(0, 1); const int l = level_ - 1; - int high = 0xff - l * 0x10, low = l * 0x20; // rgb calculation limits us to 16 levels (1--16) + int high = 0xff - (l / 2) * 0x10; + int low = l * 0x10; int green = 0; if(low >= 0x100){ low = low % 0x100; - green = (l - 8) * 0x20; } + green = (l / 2) * 0x20; uint64_t tl = 0, tr = 0, bl = 0, br = 0; const int c1 = level_ % 2 ? high : low; const int c2 = level_ % 2 ? low : high; channels_set_fg_rgb(&tl, c1, green, c2); channels_set_bg_alpha(&tl, CELL_ALPHA_TRANSPARENT);