more C++11 specifier

This commit is contained in:
Uwe Rathmann 2020-05-03 13:46:23 +02:00
parent 2dece458e4
commit 97be72453b

View File

@ -448,10 +448,9 @@ namespace QskRgbValue
return toTransparent( QColor( color ), alpha ); return toTransparent( QColor( color ), alpha );
} }
inline QRgb toTransparent( QRgb rgb, int alpha = 0 ) inline constexpr QRgb toTransparent( QRgb rgb, int alpha = 0 ) noexcept
{ {
const auto alphaU = static_cast< uint >( alpha ); return ( rgb & ColorMask ) | ( ( static_cast< uint >( alpha ) & 0xffu ) << 24 );
return ( rgb & ColorMask ) | ( ( alphaU & 0xffu ) << 24 );
} }
} }