toTransparentF added

This commit is contained in:
Uwe Rathmann 2022-01-07 13:55:51 +01:00
parent 1bac9f37c3
commit d1f6902c27

View File

@ -461,6 +461,11 @@ namespace QskRgb
return ( rgb & ColorMask ) | ( ( static_cast< uint >( alpha ) & 0xffu ) << 24 ); 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 ) inline QColor toTransparentF( Qt::GlobalColor color, qreal alpha )
{ {
return toTransparent( QColor( color ), qRound( alpha * 255 ) ); return toTransparent( QColor( color ), qRound( alpha * 255 ) );