/
pi_coder
/
ByteMachine
Обзор
Документация
Войти
/
pi_coder
/
ByteMachine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/colors.cpp
346 строк
8 KB
pimenov-and
Исправлено имя класса со стандратными цветами
12 июл 2026, 20:25
12 июл 2026, 20:25
f7be6a4
Код
Авторство
О чём код?
//////////////////////////////////////////////////////////////// // ByteMachine // Цвета //////////////////////////////////////////////////////////////// #include "colors.h" #include "standard_colors.h" //============================================================== // Получение цвета фона дизайнера //============================================================== QColor Colors::designerBack(ColorThemes theme) { if (isLight(theme)) { return StandardColors::white(); } else if (isDark(theme)) { return QColor{30, 30, 30}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета сетки дизайнера //============================================================== QColor Colors::designerGrid(ColorThemes theme) { if (isLight(theme)) { return QColor{225, 225, 225}; } else if (isDark(theme)) { return QColor{50, 50, 50}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета границы узла //============================================================== QColor Colors::nodeBorder(ColorThemes theme) { if (isLight(theme)) { return QColor{110, 110, 110}; } else if (isDark(theme)) { return QColor{140, 140, 140}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона пина //============================================================== QColor Colors::nodePinBack(ColorThemes theme) { if (isLight(theme)) { return StandardColors::white(); } else if (isDark(theme)) { return QColor{45, 45, 45}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона подключенного пина //============================================================== QColor Colors::nodeConnectPinBack(ColorThemes theme) { if (isLight(theme)) { return QColor{180, 180, 180}; } else if (isDark(theme)) { return QColor{35, 35, 35}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвет фона узла //============================================================== QColor Colors::nodeBack(ColorThemes theme) { if (isLight(theme)) { return StandardColors::white(); } else if (isDark(theme)) { return QColor{45, 45, 45}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета текста узла //============================================================== QColor Colors::nodeText(ColorThemes theme) { if (isLight(theme)) { return QColor{10, 10, 10}; } else if (isDark(theme)) { return QColor{190, 190, 190}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета границы выделенного узла //============================================================== QColor Colors::nodeSelectBorder(ColorThemes theme) { if (isLight(theme)) { return QColor{60, 60, 255}; } else if (isDark(theme)) { return QColor{0, 107, 214}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета границы вторично выделенного узла //============================================================== QColor Colors::nodeSecondSelectBorder(ColorThemes theme) { if (isLight(theme)) { return QColor{0, 156, 0}; } else if (isDark(theme)) { return QColor{}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета рамки области состояния узла при предупреждении //============================================================== QColor Colors::nodeWarnStateAreaBorder(ColorThemes theme) { if (isLight(theme)) { return StandardColors::black(); } else if (isDark(theme)) { return StandardColors::yellow(); } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона области состояния узла при предупреждении //============================================================== QColor Colors::nodeWarnStateAreaBack(ColorThemes theme) { if (isLight(theme)) { return StandardColors::yellow(); } else if (isDark(theme)) { return StandardColors::yellow(); } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета рамки области состояния узла при ошибке //============================================================== QColor Colors::nodeErrStateAreaBorder(ColorThemes theme) { if (isLight(theme)) { return StandardColors::black(); } else if (isDark(theme)) { return QColor{255, 107, 107}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона области состояния узла при ошибке //============================================================== QColor Colors::nodeErrStateAreaBack(ColorThemes theme) { if (isLight(theme)) { return QColor{255, 107, 107}; } else if (isDark(theme)) { return QColor{255, 107, 107}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона области с именем бренда //============================================================== QColor Colors::statusBarVersionAreaBackColor(ColorThemes theme) { if (isLight(theme)) { return QColor{0, 80, 152}; } else if (isDark(theme)) { return QColor{}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета фона статус-бара //============================================================== QColor Colors::statusBarBackColor(ColorThemes theme) { if (isLight(theme)) { return QColor{0, 122, 204}; } else if (isDark(theme)) { return QColor{}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Получение цвета текста статус-бара //============================================================== QColor Colors::statusBarTextColor(ColorThemes theme) { if (isLight(theme)) { return StandardColors::white(); } else if (isDark(theme)) { return QColor{}; } else { qDebug("Bad color theme"); return QColor{}; } } //============================================================== // Цвет фона элемента узла //============================================================== QColor Colors::nodePanelItemBack(ColorThemes theme) { if (isLight(theme)) { return QColor{198, 231, 255}; } else if (isDark(theme)) { return QColor{198, 231, 255, 110}; } else { qDebug("Bad color theme"); return QColor{}; } }