From d1f6902c270917b1e6d42b5f2233f719c835d4b1 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 7 Jan 2022 13:55:51 +0100 Subject: [PATCH] toTransparentF added --- src/common/QskRgbValue.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/QskRgbValue.h b/src/common/QskRgbValue.h index 21580835..6fea8d95 100644 --- a/src/common/QskRgbValue.h +++ b/src/common/QskRgbValue.h @@ -461,6 +461,11 @@ namespace QskRgb return ( rgb & ColorMask ) | ( ( static_cast< uint >( alpha ) & 0xffu ) << 24 ); } + inline QColor toTransparentF( const QColor& color, qreal alpha ) + { + return toTransparent( color, qRound( alpha * 255 ) ); + } + inline QColor toTransparentF( Qt::GlobalColor color, qreal alpha ) { return toTransparent( QColor( color ), qRound( alpha * 255 ) );