Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
colour.h
1/*
2 * Copyright © 2020-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19#include "gui/menu_item/selection.h"
20
21namespace deluge::gui::menu_item {
22
23constexpr int32_t kNumPadColours = 9;
24class Colour final : public Selection {
25public:
26 enum Option : uint8_t {
27 RED,
28 GREEN,
29 BLUE,
30 YELLOW,
31 CYAN,
32 MAGENTA,
33 AMBER,
34 WHITE,
35 PINK,
36 };
37
38 using Selection::Selection;
39 void readCurrentValue() override { this->setValue(value); }
40 void writeCurrentValue() override {
41 value = static_cast<Option>(this->getValue());
42 renderingNeededRegardlessOfUI();
43 };
44 deluge::vector<std::string_view> getOptions(OptType optType) override {
45 return {
46 l10n::getView(l10n::String::STRING_FOR_RED), l10n::getView(l10n::String::STRING_FOR_GREEN),
47 l10n::getView(l10n::String::STRING_FOR_BLUE), l10n::getView(l10n::String::STRING_FOR_YELLOW),
48 l10n::getView(l10n::String::STRING_FOR_CYAN), l10n::getView(l10n::String::STRING_FOR_MAGENTA),
49 l10n::getView(l10n::String::STRING_FOR_AMBER), l10n::getView(l10n::String::STRING_FOR_WHITE),
50 l10n::getView(l10n::String::STRING_FOR_PINK),
51 };
52 }
53 [[nodiscard]] RGB getRGB() const;
54 Option value;
55};
56
57extern Colour activeColourMenu;
58extern Colour stoppedColourMenu;
59extern Colour mutedColourMenu;
60extern Colour soloColourMenu;
61extern Colour fillColourMenu;
62extern Colour onceColourMenu;
63} // namespace deluge::gui::menu_item
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition colour.h:24
void readCurrentValue() override
Like readValueAgain, but does not redraw.
Definition colour.h:39
Definition selection.h:26