From 1bcb38038af7aa2b077a4ae427cd4cf6a9233d7c Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 16 May 2017 20:21:32 +0200 Subject: [PATCH] New value dial color schemes: make the background a little bit darker and mark an embossed border --- sdrbase/gui/colormapper.cpp | 54 ++++++++++++++++++++++++------------- sdrbase/gui/colormapper.h | 4 +++ sdrbase/gui/valuedial.cpp | 8 ++++++ 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/sdrbase/gui/colormapper.cpp b/sdrbase/gui/colormapper.cpp index 5edd9cd86..1affb8873 100644 --- a/sdrbase/gui/colormapper.cpp +++ b/sdrbase/gui/colormapper.cpp @@ -25,6 +25,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0xff, 0xd9, 0xab, 0x80); m_boundaryColor = QColor(0x21, 0x1c, 0x16); m_boundaryAlphaColor = QColor(0x00, 0x00, 0x00, 0x20); + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case ReverseGold: /* @@ -48,6 +50,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0xbf, 0x69, 0x00, 0x80); // 75% saturation m_boundaryColor = QColor(0x66, 0x38, 0x20); // 69% saturation 40% brightness m_boundaryAlphaColor = QColor(0xff, 0x8b, 0x00, 0x20); // Base with alpha + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case ReverseGreenEmerald: m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(0x00, 0x96, 0x26))); // 59% brightness @@ -62,6 +66,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0x40, 0xff, 0x70, 0x80); // 75% saturation m_boundaryColor = QColor(0x20, 0x66, 0x31); // 69% saturation 40% brightness m_boundaryAlphaColor = QColor(0x80, 0xff, 0x40, 0x20); // Base with alpha + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case ReverseGreen: m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(0x00, 0x96, 0x00))); // 59% brightness @@ -76,6 +82,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0x40, 0xff, 0x40, 0x80); // 75% saturation m_boundaryColor = QColor(0x20, 0x66, 0x20); // 69% saturation 40% brightness m_boundaryAlphaColor = QColor(0x00, 0xff, 0x00, 0x20); // Base with alpha + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case ReverseGreenApple: m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(0x26, 0x96, 0x00))); // 59% brightness @@ -90,6 +98,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0x70, 0xff, 0x40, 0x80); // 75% saturation m_boundaryColor = QColor(0x31, 0x66, 0x20); // 69% saturation 40% brightness m_boundaryAlphaColor = QColor(0x40, 0xff, 0x00, 0x20); // Base with alpha + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case ReverseGreenYellow: m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(0x53, 0x96, 0x00))); // 59% brightness @@ -104,34 +114,40 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0xa9, 0xff, 0x40, 0x80); // 75% saturation m_boundaryColor = QColor(0x46, 0x66, 0x20); // 69% saturation 40% brightness m_boundaryAlphaColor = QColor(0x8c, 0xff, 0x00, 0x20); // Base with alpha + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; - case GrayGreenYellow: // Base 87 (=120-33) degrees hue 140,255,0 - m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(33, 33, 33))); // 59% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.1, QColor(50, 50, 50))); // 37% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.2, QColor(67, 67, 67))); // 18% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.5, QColor(80, 80, 80))); // 0% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.8, QColor(60, 60, 60))); // 25% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.9, QColor(50, 50, 50))); // 37% darkness - m_dialBackgroundcolorMap.push_back(std::pair(1.0, QColor(33, 33, 33))); // 59% darkness + case GrayGreenYellow: // Base 87 (=120-33) degrees hue 140,255,0 - background 67, 67, 67 + m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(27, 27, 27))); // 59% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.1, QColor(42, 42, 42))); // 37% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.2, QColor(55, 55, 55))); // 18% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.5, QColor(67, 67, 67))); // 0% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.8, QColor(50, 50, 50))); // 25% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.9, QColor(42, 42, 42))); // 37% darkness + m_dialBackgroundcolorMap.push_back(std::pair(1.0, QColor(27, 27, 27))); // 59% darkness m_foregroundColor = QColor(99, 128, 64); // 50% saturation 50% brightbess - shadow face color m_secondaryForegroundColor = QColor(198, 255, 128); // 50% saturation - front face color m_highlightColor = QColor(169, 255, 64, 80); // 75% saturation - digit highlight overlay - m_boundaryColor = QColor(32, 32, 32); // background 60% darkness - inter wheel gap + m_boundaryColor = QColor(27, 27, 27); // background 60% darkness - inter wheel gap m_boundaryAlphaColor = QColor(140, 255, 0, 32); // Base with alpha - wheel edges + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; - case GrayGold: // Base 33 degrees hue 255,139,0 - m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(33, 33, 33))); // 59% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.1, QColor(50, 50, 50))); // 37% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.2, QColor(67, 67, 67))); // 18% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.5, QColor(80, 80, 80))); // 0% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.8, QColor(60, 60, 60))); // 25% darkness - m_dialBackgroundcolorMap.push_back(std::pair(0.9, QColor(50, 50, 50))); // 37% darkness - m_dialBackgroundcolorMap.push_back(std::pair(1.0, QColor(33, 33, 33))); // 59% darkness + case GrayGold: // Base 33 degrees hue 255,139,0 - background 67, 67, 67 + m_dialBackgroundcolorMap.push_back(std::pair(0.0, QColor(27, 27, 27))); // 59% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.1, QColor(42, 42, 42))); // 37% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.2, QColor(55, 55, 55))); // 18% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.5, QColor(67, 67, 67))); // 0% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.8, QColor(50, 50, 50))); // 25% darkness + m_dialBackgroundcolorMap.push_back(std::pair(0.9, QColor(42, 42, 42))); // 37% darkness + m_dialBackgroundcolorMap.push_back(std::pair(1.0, QColor(27, 27, 27))); // 59% darkness m_foregroundColor = QColor(128, 98, 64); // 50% saturation 50% brightbess - shadow face color m_secondaryForegroundColor = QColor(255, 197, 128); // 50% saturation - front face color m_highlightColor = QColor(255, 169, 64, 80); // 75% saturation - digit highlight overlay - m_boundaryColor = QColor(32, 32, 32); // background 60% darkness - inter wheel gap + m_boundaryColor = QColor(27, 27, 27); // background 60% darkness - inter wheel gap m_boundaryAlphaColor = QColor(255, 139, 0, 32); // Base with alpha - wheel edges + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); break; case Normal: default: @@ -147,6 +163,8 @@ ColorMapper::ColorMapper(Theme theme) : m_highlightColor = QColor(0xff, 0x00, 0x00, 0x20); m_boundaryColor = QColor(0x20, 0x20, 0x20); m_boundaryAlphaColor = QColor(0x00, 0x00, 0x00, 0x20); + m_lightBorderColor = QColor(80, 80, 80); + m_darkBorderColor = QColor(0, 0, 0); } } diff --git a/sdrbase/gui/colormapper.h b/sdrbase/gui/colormapper.h index e13dee659..60b85578d 100644 --- a/sdrbase/gui/colormapper.h +++ b/sdrbase/gui/colormapper.h @@ -38,6 +38,8 @@ public: const QColor& getHighlightColor() const { return m_highlightColor; }; const QColor& getBoundaryColor() const { return m_boundaryColor; }; const QColor& getBoundaryAlphaColor() const { return m_boundaryAlphaColor; }; + const QColor& getLightBorderColor() const { return m_lightBorderColor; }; + const QColor& getDarkBorderColor() const { return m_darkBorderColor; }; private: Theme m_theme; @@ -47,6 +49,8 @@ private: QColor m_highlightColor; QColor m_boundaryColor; QColor m_boundaryAlphaColor; + QColor m_lightBorderColor; + QColor m_darkBorderColor; }; #endif /* INCLUDE_GPL_GUI_COLORMAPPER_H_ */ diff --git a/sdrbase/gui/valuedial.cpp b/sdrbase/gui/valuedial.cpp index 91223c864..c16f083fd 100644 --- a/sdrbase/gui/valuedial.cpp +++ b/sdrbase/gui/valuedial.cpp @@ -194,6 +194,14 @@ void ValueDial::paintEvent(QPaintEvent*) painter.drawLine(1, 1, 1, height() - 1); painter.drawLine(width() - 2, 1, width() - 2, height() - 1); + // dial borders + painter.setPen(m_colorMapper.getLightBorderColor()); + painter.drawLine(0, height() - 1, width() - 1, height() - 1); + painter.drawLine(width() - 1, height() - 1, width() - 1, 0); + painter.setPen(m_colorMapper.getDarkBorderColor()); + painter.drawLine(0, 0, width() - 1, 0); + painter.drawLine(0, height() - 1, 0, 0); + if(m_hightlightedDigit >= 0) { painter.setPen(Qt::NoPen); painter.setBrush(m_colorMapper.getHighlightColor());