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

Method getDeviceTopColor

app/src/SerialStudio.cpp:720–732  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

718 * @brief Returns the top gradient color for the given device source index.
719 */
720QColor SerialStudio::getDeviceTopColor(const int sourceId)
721{
722 if (sourceId <= 0)
723 return QColor(Qt::transparent);
724
725 static const auto* theme = &Misc::ThemeManager::instance();
726 const auto& colors = theme->deviceColors();
727
728 if (colors.isEmpty())
729 return QColor(Qt::transparent);
730
731 return colors.at((sourceId - 1) % colors.count()).first;
732}
733
734/**
735 * @brief Returns the bottom gradient color for the given device source index.

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected