fix the phosphoric fade effect on program 4

This commit is contained in:
true 2024-08-02 19:39:01 -07:00
parent 6a2de9a6a6
commit 5adce05f84
1 changed files with 12 additions and 19 deletions

View File

@ -404,27 +404,20 @@ void led_rgb_4_typing(uint8_t preview, uint8_t tick)
// set rgb colors as appropriate
for (i = 0; i < 9; i++) {
if (i < typing_idx || ((i == typing_idx) && (typing_flash_state))) {
// these are on
rgb[i][0] = typing[color][0];
rgb[i][1] = typing[color][1];
rgb[i][2] = typing[color][2];
}
for (j = 0; j < 3; j++) {
if ((i < typing_idx) || ((i == typing_idx) && typing_flash_state)) {
// these are on
rgb[i][j] = typing[color][j];
}
if (i > typing_idx || ((i == typing_idx) && (!typing_flash_state))) {
// these are idle
rgb[i][0] = idle_glow[0];
rgb[i][1] = idle_glow[1];
rgb[i][2] = idle_glow[2];
}
if (i > typing_idx) { // || ((i == typing_idx) && !typing_flash_state)) {
// these are idle
rgb[i][j] = idle_glow[j];
}
// flashing cursor fadeout
if (i == typing_idx && typing_flash_state) {
if (typing_flash_delay <= 8) {
w = 8 - typing_flash_delay;
rgb[i][0] >>= w; if (rgb[i][0] < idle_glow[0]) rgb[i][0] = idle_glow[0];
rgb[i][1] >>= w; if (rgb[i][1] < idle_glow[1]) rgb[i][1] = idle_glow[1];
rgb[i][2] >>= w; if (rgb[i][2] < idle_glow[2]) rgb[i][2] = idle_glow[2];
// flashing cursor fadeout
if ((i == typing_idx) && !typing_flash_state) {
if (rgb[i][j] > 32) rgb[i][j] -= 32; else rgb[i][j] = 0;
update = 1;
}
}