/
pi_coder
/
ByteMachine
Обзор
Документация
Войти
/
pi_coder
/
ByteMachine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/color_themes.h
58 строк
2 KB
pimenov-and
Добавлены файлы из старого проекта
12 июл 2026, 20:19
12 июл 2026, 20:19
fbe5753
Код
Авторство
О чём код?
//////////////////////////////////////////////////////////////// // ByteMachine // Цветовые темы //////////////////////////////////////////////////////////////// #ifndef COLOR_THEMES_H #define COLOR_THEMES_H //============================================================== #include <QString> #include <QMetaType> #include <QVector> //============================================================== // Цветовые схемы //============================================================== enum class ColorThemes { Unknown = -1, Light, Dark }; //============================================================== Q_DECLARE_METATYPE(ColorThemes) //============================================================== // Прототипы функций //============================================================== // Перевод цветовой схемы в строку [[nodiscard]] QString colorThemeToStr(ColorThemes scheme); // Перевод строки в цветовую схему [[nodiscard]] ColorThemes strToColorTheme(const QString &str); // Перевод цветовой схемы в число [[nodiscard]] constexpr inline int colorThemeToInt(ColorThemes scheme) noexcept { return static_cast<int>(scheme); } // Перевод числа в цветовую схему [[nodiscard]] ColorThemes intToColorTheme(int value) noexcept; // Получение признака ColorThemes::Unknown [[nodiscard]] constexpr inline bool isUnknown(ColorThemes scheme) { return scheme == ColorThemes::Unknown; } // Получение признака ColorThemes::Light [[nodiscard]] constexpr inline bool isLight(ColorThemes scheme) noexcept { return scheme == ColorThemes::Light; } // Получение признака ColorThemes::Dark [[nodiscard]] constexpr inline bool isDark(ColorThemes scheme) noexcept { return scheme == ColorThemes::Dark; } // Получение цветовых схем [[nodiscard]] QVector<ColorThemes> colorSchemeValues(); // Проверка корректности цветовой схемы [[nodiscard]] bool isCorrect(ColorThemes scheme); //============================================================== #endif // COLOR_THEMES_H