From 75395e2900c7469213899b6fe5616fab8f1084ec Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 18 Oct 2017 19:47:23 +0200 Subject: [PATCH] QskRgbValue::toTransparent added --- src/controls/QskRgbValue.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/controls/QskRgbValue.h b/src/controls/QskRgbValue.h index f3a3b25b..df768ebf 100644 --- a/src/controls/QskRgbValue.h +++ b/src/controls/QskRgbValue.h @@ -6,6 +6,7 @@ #ifndef QSK_RGB_VALUE_H #define QSK_RGB_VALUE_H +#include "QskGlobal.h" #include #define QSK_RGB_VALUES \ @@ -433,8 +434,18 @@ namespace QskRgbValue QSK_RGB_VALUES #undef RGB - QRgb interpolated( QRgb rgb1, QRgb rgb2, qreal ratio ); - QColor interpolated( const QColor& c1, const QColor& c2, qreal ratio ); + QSK_EXPORT QRgb interpolated( QRgb rgb1, QRgb rgb2, qreal ratio ); + QSK_EXPORT QColor interpolated( const QColor& c1, const QColor& c2, qreal ratio ); + + inline QColor toTransparent( const QColor& c1, int alpha = 0 ) + { + return QColor::fromRgba( ( c1.rgb() & ColorMask ) | ( alpha & AlphaMask ) ); + } + + inline QRgb toTransparent( QRgb rgb, int alpha = 0 ) + { + return ( rgb & ColorMask ) | ( alpha & AlphaMask ); + } } #endif