-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLED-Palette-Theme-Defy.h
56 lines (44 loc) · 2.05 KB
/
LED-Palette-Theme-Defy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* -*- mode: c++ -*-
* Kaleidoscope-LED-Palette-Theme -- Palette-based LED theme foundation
* Copyright (C) 2017, 2018 Keyboard.io, Inc
* Copyright (C) 2023, 2024 DygmaLabs, S. L.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "kaleidoscope/Runtime.h"
#include "Communications_protocol.h"
#include <Kaleidoscope-LEDControl.h>
namespace kaleidoscope {
namespace plugin {
class LEDPaletteThemeDefy : public kaleidoscope::Plugin {
public:
LEDPaletteThemeDefy(void) {}
static uint16_t reserveThemes(uint8_t max_themes);
static void updateHandler(uint16_t theme_base, uint8_t theme);
static void refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_addr);
static const uint8_t lookupColorIndexAtPosition(uint16_t theme_base, uint16_t position);
static const cRGB lookupColorAtPosition(uint16_t theme_base, uint16_t position);
static void updateColorIndexAtPosition(uint16_t theme_base, uint16_t position, uint8_t color_index);
static void getColorPalette(cRGB output_palette[16]);
static const cRGB lookupPaletteColor(uint8_t palette_index);
EventHandlerResult onFocusEvent(const char *command);
static void updatePaletteColor(uint8_t i, cRGB rgb);
static void updatePaletteCommunication(Communications_protocol::Packet &packet);
private:
static uint16_t palette_base_;
static uint16_t leds_per_layer_in_memory_;
};
} // namespace plugin
} // namespace kaleidoscope
extern kaleidoscope::plugin::LEDPaletteThemeDefy LEDPaletteThemeDefy;