MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / getDeviceBottomColor

Method getDeviceBottomColor

app/src/SerialStudio.cpp:737–749  ·  view source on GitHub ↗

* @brief Returns the bottom gradient color for the given device source index. */

Source from the content-addressed store, hash-verified

735 * @brief Returns the bottom gradient color for the given device source index.
736 */
737QColor SerialStudio::getDeviceBottomColor(const int sourceId)
738{
739 if (sourceId <= 0)
740 return QColor(Qt::transparent);
741
742 static const auto* theme = &Misc::ThemeManager::instance();
743 const auto& colors = theme->deviceColors();
744
745 if (colors.isEmpty())
746 return QColor(Qt::transparent);
747
748 return colors.at((sourceId - 1) % colors.count()).second;
749}
750
751/**
752 * @brief Returns a saturated accent color for a given device index.

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected