Wireshark  4.3.0
The Wireshark network protocol analyzer
color_utils.h
Go to the documentation of this file.
1 
10 #ifndef COLOR_UTILS_H
11 #define COLOR_UTILS_H
12 
13 #include <config.h>
14 
15 #include <epan/color_filters.h>
16 
17 #include <QBrush>
18 #include <QColor>
19 #include <QObject>
20 
21 class ColorUtils : public QObject
22 {
23 public:
24  explicit ColorUtils(QObject *parent = 0);
25 
26  static QColor fromColorT(const color_t *color);
27  static QColor fromColorT(color_t color);
28  static const color_t toColorT(const QColor color);
29  static QRgb alphaBlend(const QColor &color1, const QColor &color2, qreal alpha);
30  static QRgb alphaBlend(const QBrush &brush1, const QBrush &brush2, qreal alpha);
31 
32  // ...because they don't really fit anywhere else?
33  static const QColor expert_color_comment; /* green */
34  static const QColor expert_color_chat; /* light blue */
35  static const QColor expert_color_note; /* bright turquoise */
36  static const QColor expert_color_warn; /* yellow */
37  static const QColor expert_color_error; /* pale red */
38  static const QColor expert_color_foreground; /* black */
39  static const QColor hidden_proto_item; /* gray */
40 
41  static const QList<QRgb> graphColors();
42  static QRgb graphColor(int item);
43  static QRgb sequenceColor(int item);
44 
51  static bool themeIsDark();
56  static QBrush themeLinkBrush();
61  static QString themeLinkStyle();
69  static const QColor contrastingTextColor(const QColor color);
70 
75  static const QColor hoverBackground();
76 
81  static const QColor warningBackground();
82 
87  static const QColor disabledForeground();
88 
89 private:
90  static QList<QRgb> graph_colors_;
91  static QList<QRgb> sequence_colors_;
92 };
93 
94 void color_filter_qt_add_cb(color_filter_t *colorf, void *user_data);
95 
96 #endif // COLOR_UTILS_H
Definition: color_utils.h:22
static const QColor warningBackground()
Definition: color_utils.cpp:218
static const QColor contrastingTextColor(const QColor color)
Definition: color_utils.cpp:196
static const QColor disabledForeground()
Definition: color_utils.cpp:226
static bool themeIsDark()
Definition: color_utils.cpp:148
static const QColor hoverBackground()
Definition: color_utils.cpp:207
static QBrush themeLinkBrush()
Definition: color_utils.cpp:174
static QString themeLinkStyle()
Definition: color_utils.cpp:185
Definition: color_filters.h:33
Definition: color.h:23