From 13cb2f8ca3a5536110813d1201c84d2eb41bdbdb Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 7 Jan 2022 13:23:29 +0100 Subject: [PATCH] QskRgb::totransparentF added --- src/common/QskRgbValue.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 55d9a86c..21580835 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -461,6 +461,16 @@ namespace QskRgb return ( rgb & ColorMask ) | ( ( static_cast< uint >( alpha ) & 0xffu ) << 24 ); } + inline QColor toTransparentF( Qt::GlobalColor color, qreal alpha ) + { + return toTransparent( QColor( color ), qRound( alpha * 255 ) ); + } + + inline constexpr QRgb toTransparentF( QRgb rgb, qreal alpha ) noexcept + { + return toTransparent( rgb, qRound( alpha * 255 ) ); + } + QSK_EXPORT QRgb lighter( QRgb, int factor = 150 ) noexcept; QSK_EXPORT QRgb darker( QRgb, int factor = 200 ) noexcept; }