aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/color_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/color_utils.cpp')
-rw-r--r--ui/qt/color_utils.cpp10
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);