* @brief Returns the bottom gradient color for the given device source index. */
| 735 | * @brief Returns the bottom gradient color for the given device source index. |
| 736 | */ |
| 737 | QColor 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. |