SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
sdrgui
gui
colormapper.cpp
Go to the documentation of this file.
1
/*
2
* colormap.cpp
3
*
4
* Created on: Jul 19, 2015
5
* Author: f4exb
6
*/
7
8
#include <
gui/colormapper.h
>
9
10
ColorMapper::ColorMapper
(
Theme
theme) :
11
m_theme(theme)
12
{
13
switch
(
m_theme
)
14
{
15
case
Gold
:
16
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x40, 0x36, 0x2b)));
17
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0xbf, 0xa3, 0x80)));
18
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0xf0, 0xcc, 0xa1)));
19
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0xff, 0xd9, 0xab)));
20
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0xd1, 0xb2, 0x8c)));
21
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0xa1, 0x89, 0x6c)));
22
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x40, 0x36, 0x2b)));
23
m_foregroundColor
= QColor(0x00, 0x00, 0x00);
24
m_secondaryForegroundColor
= QColor(0x0f, 0x0d, 0x0a);
25
m_highlightColor
= QColor(0xff, 0xd9, 0xab, 0x80);
26
m_boundaryColor
= QColor(0x21, 0x1c, 0x16);
27
m_boundaryAlphaColor
= QColor(0x00, 0x00, 0x00, 0x20);
28
m_lightBorderColor
= QColor(80, 80, 80);
29
m_darkBorderColor
= QColor(0, 0, 0);
30
break
;
31
case
ReverseGold
:
32
/*
33
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.0, QColor(0x97, 0x54, 0x00)));
34
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.1, QColor(0x5e, 0x34, 0x00)));
35
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.2, QColor(0x2e, 0x19, 0x00)));
36
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
37
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.8, QColor(0x0f, 0x08, 0x00)));
38
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(0.9, QColor(0x40, 0x23, 0x00)));
39
m_dialBackgroundcolorMap.push_back(std::pair<float, QColor>(1.0, QColor(0x97, 0x54, 0x00)));
40
*/
41
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x97, 0x54, 0x00)));
// 59% brightness
42
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0x5e, 0x34, 0x00)));
// 37% brightness
43
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0x2e, 0x19, 0x00)));
// 18% brightness
44
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
// 0% brightness
45
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0x40, 0x23, 0x00)));
// 25% brightness
46
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0x5e, 0x34, 0x00)));
// 37% brightness
47
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x97, 0x54, 0x00)));
// 59% brightness
48
m_foregroundColor
= QColor(0xff, 0x8b, 0x00);
// Base 33 degrees hue
49
m_secondaryForegroundColor
= QColor(0xff, 0xc5, 0x80);
// 50% saturation
50
m_highlightColor
= QColor(0xbf, 0x69, 0x00, 0x80);
// 75% saturation
51
m_boundaryColor
= QColor(0x66, 0x38, 0x20);
// 69% saturation 40% brightness
52
m_boundaryAlphaColor
= QColor(0xff, 0x8b, 0x00, 0x20);
// Base with alpha
53
m_lightBorderColor
= QColor(80, 80, 80);
54
m_darkBorderColor
= QColor(0, 0, 0);
55
break
;
56
case
ReverseGreenEmerald
:
57
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x00, 0x96, 0x26)));
// 59% brightness
58
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0x00, 0x5e, 0x10)));
// 37% brightness
59
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0x00, 0x2e, 0x0b)));
// 18% brightness
60
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
// 0% brightness
61
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0x00, 0x40, 0x10)));
// 25% brightness
62
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0x00, 0x5e, 0x10)));
// 37% brightness
63
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x00, 0x96, 0x26)));
// 59% brightness
64
m_foregroundColor
= QColor(0x00, 0xff, 0x40);
// Base 135 degrees hue
65
m_secondaryForegroundColor
= QColor(0x80, 0xff, 0x9f);
// 50% saturation
66
m_highlightColor
= QColor(0x40, 0xff, 0x70, 0x80);
// 75% saturation
67
m_boundaryColor
= QColor(0x20, 0x66, 0x31);
// 69% saturation 40% brightness
68
m_boundaryAlphaColor
= QColor(0x80, 0xff, 0x40, 0x20);
// Base with alpha
69
m_lightBorderColor
= QColor(80, 80, 80);
70
m_darkBorderColor
= QColor(0, 0, 0);
71
break
;
72
case
ReverseGreen
:
73
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x00, 0x96, 0x00)));
// 59% brightness
74
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0x00, 0x5e, 0x00)));
// 37% brightness
75
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0x00, 0x2e, 0x00)));
// 18% brightness
76
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
// 0% brightness
77
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0x00, 0x40, 0x00)));
// 25% brightness
78
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0x00, 0x5e, 0x00)));
// 37% brightness
79
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x00, 0x96, 0x00)));
// 59% brightness
80
m_foregroundColor
= QColor(0x00, 0xff, 0x00);
// Base 120 degrees hue (pure green)
81
m_secondaryForegroundColor
= QColor(0x80, 0xff, 0x80);
// 50% saturation
82
m_highlightColor
= QColor(0x40, 0xff, 0x40, 0x80);
// 75% saturation
83
m_boundaryColor
= QColor(0x20, 0x66, 0x20);
// 69% saturation 40% brightness
84
m_boundaryAlphaColor
= QColor(0x00, 0xff, 0x00, 0x20);
// Base with alpha
85
m_lightBorderColor
= QColor(80, 80, 80);
86
m_darkBorderColor
= QColor(0, 0, 0);
87
break
;
88
case
ReverseGreenApple
:
89
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x26, 0x96, 0x00)));
// 59% brightness
90
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0x10, 0x5e, 0x00)));
// 37% brightness
91
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0x0b, 0x2e, 0x00)));
// 18% brightness
92
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
// 0% brightness
93
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0x10, 0x40, 0x00)));
// 25% brightness
94
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0x10, 0x5e, 0x00)));
// 37% brightness
95
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x26, 0x96, 0x00)));
// 59% brightness
96
m_foregroundColor
= QColor(0x40, 0xff, 0x00);
// Base 105 degrees hue (opposite towards red of emerald w.r. to pure green)
97
m_secondaryForegroundColor
= QColor(0x9f, 0xff, 0x80);
// 50% saturation
98
m_highlightColor
= QColor(0x70, 0xff, 0x40, 0x80);
// 75% saturation
99
m_boundaryColor
= QColor(0x31, 0x66, 0x20);
// 69% saturation 40% brightness
100
m_boundaryAlphaColor
= QColor(0x40, 0xff, 0x00, 0x20);
// Base with alpha
101
m_lightBorderColor
= QColor(80, 80, 80);
102
m_darkBorderColor
= QColor(0, 0, 0);
103
break
;
104
case
ReverseGreenYellow
:
105
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x53, 0x96, 0x00)));
// 59% brightness
106
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0x34, 0x5e, 0x00)));
// 37% brightness
107
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0x19, 0x2e, 0x00)));
// 18% brightness
108
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0x00, 0x00, 0x00)));
// 0% brightness
109
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0x23, 0x40, 0x00)));
// 25% brightness
110
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0x34, 0x5e, 0x00)));
// 37% brightness
111
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x53, 0x96, 0x00)));
// 59% brightness
112
m_foregroundColor
= QColor(0x8c, 0xff, 0x00);
// Base 87 (=120-33) degrees hue
113
m_secondaryForegroundColor
= QColor(0xc6, 0xff, 0x80);
// 50% saturation
114
m_highlightColor
= QColor(0xa9, 0xff, 0x40, 0x80);
// 75% saturation
115
m_boundaryColor
= QColor(0x46, 0x66, 0x20);
// 69% saturation 40% brightness
116
m_boundaryAlphaColor
= QColor(0x8c, 0xff, 0x00, 0x20);
// Base with alpha
117
m_lightBorderColor
= QColor(80, 80, 80);
118
m_darkBorderColor
= QColor(0, 0, 0);
119
break
;
120
case
GrayGreenYellow
:
// Base 87 (=120-33) degrees hue 140,255,0 - background 67, 67, 67
121
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(27, 27, 27)));
// 59% darkness
122
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(42, 42, 42)));
// 37% darkness
123
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(55, 55, 55)));
// 18% darkness
124
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(67, 67, 67)));
// 0% darkness
125
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(50, 50, 50)));
// 25% darkness
126
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(42, 42, 42)));
// 37% darkness
127
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(27, 27, 27)));
// 59% darkness
128
m_foregroundColor
= QColor(99, 128, 64);
// 50% saturation 50% brightbess - shadow face color
129
m_secondaryForegroundColor
= QColor(198, 255, 128);
// 50% saturation - front face color
130
m_highlightColor
= QColor(169, 255, 64, 80);
// 75% saturation - digit highlight overlay
131
m_boundaryColor
= QColor(27, 27, 27);
// background 60% darkness - inter wheel gap
132
m_boundaryAlphaColor
= QColor(140, 255, 0, 32);
// Base with alpha - wheel edges
133
m_lightBorderColor
= QColor(80, 80, 80);
134
m_darkBorderColor
= QColor(0, 0, 0);
135
break
;
136
case
GrayGold
:
// Base 33 degrees hue 255,139,0 - background 67, 67, 67
137
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(27, 27, 27)));
// 59% darkness
138
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(42, 42, 42)));
// 37% darkness
139
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(55, 55, 55)));
// 18% darkness
140
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(67, 67, 67)));
// 0% darkness
141
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(50, 50, 50)));
// 25% darkness
142
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(42, 42, 42)));
// 37% darkness
143
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(27, 27, 27)));
// 59% darkness
144
m_foregroundColor
= QColor(128, 98, 64);
// 50% saturation 50% brightbess - shadow face color
145
m_secondaryForegroundColor
= QColor(255, 197, 128);
// 50% saturation - front face color
146
m_highlightColor
= QColor(255, 169, 64, 80);
// 75% saturation - digit highlight overlay
147
m_boundaryColor
= QColor(27, 27, 27);
// background 60% darkness - inter wheel gap
148
m_boundaryAlphaColor
= QColor(255, 139, 0, 32);
// Base with alpha - wheel edges
149
m_lightBorderColor
= QColor(80, 80, 80);
150
m_darkBorderColor
= QColor(0, 0, 0);
151
break
;
152
case
GrayYellow
:
// Base 50 degrees hue 255,213,0 - background 67, 67, 67
153
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(27, 27, 27)));
// 59% darkness
154
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(42, 42, 42)));
// 37% darkness
155
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(55, 55, 55)));
// 18% darkness
156
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(67, 67, 67)));
// 0% darkness
157
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(50, 50, 50)));
// 25% darkness
158
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(42, 42, 42)));
// 37% darkness
159
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(27, 27, 27)));
// 59% darkness
160
m_foregroundColor
= QColor(128, 117, 64);
// 50% saturation 50% brightbess - shadow face color
161
m_secondaryForegroundColor
= QColor(255, 234, 128);
// 50% saturation - front face color
162
m_highlightColor
= QColor(255, 233, 64, 80);
// 75% saturation - digit highlight overlay
163
m_boundaryColor
= QColor(27, 27, 27);
// background 60% darkness - inter wheel gap
164
m_boundaryAlphaColor
= QColor(255, 213, 0, 32);
// Base with alpha - wheel edges
165
m_lightBorderColor
= QColor(80, 80, 80);
166
m_darkBorderColor
= QColor(0, 0, 0);
167
break
;
168
case
Normal
:
169
default
:
170
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.0, QColor(0x40, 0x40, 0x40)));
171
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.1, QColor(0xc0, 0xc0, 0xc0)));
172
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.2, QColor(0xf0, 0xf0, 0xf0)));
173
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.5, QColor(0xff, 0xff, 0xff)));
174
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.8, QColor(0xd0, 0xd0, 0xd0)));
175
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(0.9, QColor(0xa0, 0xa0, 0xa0)));
176
m_dialBackgroundcolorMap
.push_back(std::pair<float, QColor>(1.0, QColor(0x40, 0x40, 0x40)));
177
m_foregroundColor
= QColor(0x00, 0x00, 0x00);
178
m_secondaryForegroundColor
= QColor(0x10, 0x10, 0x10);
179
m_highlightColor
= QColor(0xff, 0x00, 0x00, 0x20);
180
m_boundaryColor
= QColor(0x20, 0x20, 0x20);
181
m_boundaryAlphaColor
= QColor(0x00, 0x00, 0x00, 0x20);
182
m_lightBorderColor
= QColor(80, 80, 80);
183
m_darkBorderColor
= QColor(0, 0, 0);
184
}
185
}
186
187
ColorMapper::~ColorMapper
()
188
{
189
}
ColorMapper::m_highlightColor
QColor m_highlightColor
Definition:
colormapper.h:50
ColorMapper::GrayGreenYellow
Definition:
colormapper.h:26
ColorMapper::ColorMapper
ColorMapper(Theme theme=Normal)
Definition:
colormapper.cpp:10
ColorMapper::m_boundaryAlphaColor
QColor m_boundaryAlphaColor
Definition:
colormapper.h:52
ColorMapper::ReverseGreenApple
Definition:
colormapper.h:24
ColorMapper::ReverseGold
Definition:
colormapper.h:21
ColorMapper::m_theme
Theme m_theme
Definition:
colormapper.h:43
ColorMapper::m_foregroundColor
QColor m_foregroundColor
Definition:
colormapper.h:48
ColorMapper::m_lightBorderColor
QColor m_lightBorderColor
Definition:
colormapper.h:53
ColorMapper::ReverseGreenYellow
Definition:
colormapper.h:25
ColorMapper::m_darkBorderColor
QColor m_darkBorderColor
Definition:
colormapper.h:54
ColorMapper::m_secondaryForegroundColor
QColor m_secondaryForegroundColor
Definition:
colormapper.h:49
ColorMapper::~ColorMapper
~ColorMapper()
Definition:
colormapper.cpp:187
ColorMapper::Normal
Definition:
colormapper.h:19
ColorMapper::GrayYellow
Definition:
colormapper.h:28
ColorMapper::Theme
Theme
Definition:
colormapper.h:18
ColorMapper::ReverseGreen
Definition:
colormapper.h:23
ColorMapper::m_boundaryColor
QColor m_boundaryColor
Definition:
colormapper.h:51
ColorMapper::Gold
Definition:
colormapper.h:20
ColorMapper::GrayGold
Definition:
colormapper.h:27
ColorMapper::ReverseGreenEmerald
Definition:
colormapper.h:22
ColorMapper::m_dialBackgroundcolorMap
std::vector< std::pair< float, QColor > > m_dialBackgroundcolorMap
Definition:
colormapper.h:47
colormapper.h
Generated on Fri Aug 2 2019 17:56:33 for SDRAngel by
1.8.13