Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
color_utils.h
1 /* color_utils.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
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  Q_OBJECT
26 public:
27  explicit ColorUtils(QObject *parent = 0);
28 
29  static QColor fromColorT(const color_t *color);
30  static QColor fromColorT(color_t color);
31  static const color_t toColorT(const QColor color);
32  static QRgb alphaBlend(const QColor &color1, const QColor &color2, qreal alpha);
33  static QRgb alphaBlend(const QBrush &brush1, const QBrush &brush2, qreal alpha);
34 
35  // ...because they don't really fit anywhere else?
36  static const QColor expert_color_comment; /* green */
37  static const QColor expert_color_chat; /* light blue */
38  static const QColor expert_color_note; /* bright turquoise */
39  static const QColor expert_color_warn; /* yellow */
40  static const QColor expert_color_error; /* pale red */
41  static const QColor expert_color_foreground; /* black */
42  static const QColor hidden_proto_item; /* gray */
43 
44  static const QList<QRgb> graphColors();
45  static QRgb graphColor(int item);
46  static QRgb sequenceColor(int item);
47 
48 signals:
49 
50 public slots:
51 
52 private:
53  static QList<QRgb> graph_colors_;
54  static QList<QRgb> sequence_colors_;
55 };
56 
57 void color_filter_qt_add_cb(color_filter_t *colorf, gpointer user_data);
58 
59 #endif // COLOR_UTILS_H
60 
61 /*
62  * Editor modelines
63  *
64  * Local Variables:
65  * c-basic-offset: 4
66  * tab-width: 8
67  * indent-tabs-mode: nil
68  * End:
69  *
70  * ex: set shiftwidth=4 tabstop=8 expandtab:
71  * :indentSize=4:tabSize=8:noTabs=true:
72  */
Definition: color.h:20
Definition: color_filters.h:29
Definition: color_utils.h:23