2 Copyright 2017 Fred Sundvik
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11 You should have received a copy of the GNU General Public License
12 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #include "simple_visualizer.h"
20 #define SPRING_GREEN 64
30 // This function should be implemented by the keymap visualizer
31 // Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
32 // that the simple_visualizer assumes that you are updating
33 // Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
34 // stopped. This can be done by either double buffering it or by using constant strings
35 static void get_visualizer_layer_and_color(visualizer_state_t* state) {
36 uint8_t saturation = 255;
37 /* if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
40 if (state->status.layer & 0x100) {
41 state->target_lcd_color = LCD_COLOR(MAGENTA, saturation, 0xFF);
42 state->layer_text = "Shortcuts Layer";
44 else if (state->status.layer & 0x80) {
45 state->target_lcd_color = LCD_COLOR(VIOLET, saturation, 0xFF);
46 state->layer_text = "Plover";
48 else if (state->status.layer & 0x40) {
49 state->target_lcd_color = LCD_COLOR(RASPBERRY, saturation, 0xFF);
50 state->layer_text = "Mirrored Symbols";
52 else if (state->status.layer & 0x20) {
53 state->target_lcd_color = LCD_COLOR(RED, saturation, 0xFF);
54 state->layer_text = "Symbols";
56 else if (state->status.layer & 0x8) {
57 state->target_lcd_color = LCD_COLOR(OCEAN, saturation, 0xFF);
58 state->layer_text = "Mirrored Dvorak";
60 else if (state->status.layer & 0x4) {
61 state->target_lcd_color = LCD_COLOR(BLUE, saturation, 0xFF);
62 state->layer_text = "Dvorak";
64 else if (state->status.layer & 0x2) {
65 state->target_lcd_color = LCD_COLOR(ORANGE, saturation, 0xFF);
66 state->layer_text = "Mirrored Qwerty";
69 state->target_lcd_color = LCD_COLOR(YELLOW, saturation, 0xFF);
70 state->layer_text = "Qwerty";