diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-02-04 16:36:19 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-02-07 00:30:30 +0000 |
commit | c8cad99515eeac25faf6ea84795ce6b5fa4afebb (patch) | |
tree | ec72051d71ac3caf9331690a6f34d6255a876576 /ui/qt/color_utils.cpp | |
parent | b3f3dd8d82d9b651f34886a3293056c612958aa2 (diff) |
Qt: Add the Coloring Rules dialog.
Merge in the old ColorDialog which was a placeholder for
color_filter_add_cb.
Change-Id: I48d188509f480b8514122b4011ac9d8790fcca10
Reviewed-on: https://code.wireshark.org/review/6996
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/color_utils.cpp')
-rw-r--r-- | ui/qt/color_utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/qt/color_utils.cpp b/ui/qt/color_utils.cpp index 4210d29734..e6d7f31082 100644 --- a/ui/qt/color_utils.cpp +++ b/ui/qt/color_utils.cpp @@ -60,6 +60,16 @@ QColor ColorUtils::fromColorT(color_t color) return fromColorT(&color); } +const color_t ColorUtils::toColorT(const QColor color) +{ + color_t colort; + colort.red = (color.red() << 8) | color.red(); + colort.green = (color.green() << 8) | color.green(); + colort.blue = (color.blue() << 8) | color.blue(); + + return colort; +} + QRgb ColorUtils::alphaBlend(const QColor &color1, const QColor &color2, qreal alpha) { alpha = qBound(0.0, alpha, 1.0); |