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 <glib.h>
16 
17 #include <epan/color_filters.h>
18 
19 #include <QBrush>
20 #include <QColor>
21 #include <QObject>
22 
23 class ColorUtils : public QObject
24 {
25 public:
26  explicit ColorUtils(QObject *parent = 0);
27 
28  static QColor fromColorT(const color_t *color);
29  static QColor fromColorT(color_t color);
30  static const color_t toColorT(const QColor color);
31  static QRgb alphaBlend(const QColor &color1, const QColor &color2, qreal alpha);
32  static QRgb alphaBlend(const QBrush &brush1, const QBrush &brush2, qreal alpha);
33 
34  // ...because they don't really fit anywhere else?
35  static const QColor expert_color_comment; /* green */
36  static const QColor expert_color_chat; /* light blue */
37  static const QColor expert_color_note; /* bright turquoise */
38  static const QColor expert_color_warn; /* yellow */
39  static const QColor expert_color_error; /* pale red */
40  static const QColor expert_color_foreground; /* black */
41  static const QColor hidden_proto_item; /* gray */
42 
43  static const QList<QRgb> graphColors();
44  static QRgb graphColor(int item);
45  static QRgb sequenceColor(int item);
46 
53  static bool themeIsDark();
58  static QBrush themeLinkBrush();
63  static QString themeLinkStyle();
71  static const QColor contrastingTextColor(const QColor color);
72 
77  static const QColor hoverBackground();
78 
83  static const QColor warningBackground();
84 
85 private:
86  static QList<QRgb> graph_colors_;
87  static QList<QRgb> sequence_colors_;
88 };
89 
90 void color_filter_qt_add_cb(color_filter_t *colorf, gpointer user_data);
91 
92 #endif // COLOR_UTILS_H
Definition: color_utils.h:24
static const QColor warningBackground()
Definition: color_utils.cpp:210
static const QColor contrastingTextColor(const QColor color)
Definition: color_utils.cpp:190
static bool themeIsDark()
Definition: color_utils.cpp:148
static const QColor hoverBackground()
Definition: color_utils.cpp:199
static QBrush themeLinkBrush()
Definition: color_utils.cpp:168
static QString themeLinkStyle()
Definition: color_utils.cpp:179
Definition: color_filters.h:31
Definition: color.h:23