From b0a7f2ad19e47834bd379bcb92095223afa0a984 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 7 Jul 2023 16:09:11 +0200 Subject: [PATCH] Fluent2: Don't flatten border colors to a color without alpha value --- skins/fluent2/QskFluent2Skin.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/skins/fluent2/QskFluent2Skin.cpp b/skins/fluent2/QskFluent2Skin.cpp index 963e22a38..c64e685c6 100644 --- a/skins/fluent2/QskFluent2Skin.cpp +++ b/skins/fluent2/QskFluent2Skin.cpp @@ -139,18 +139,11 @@ namespace return qRgba( value, value, value, qRound( opacity * 255 ) ); } - inline constexpr QRgb rgbFlattened( QRgb foreground, QRgb background ) + inline QRgb rgbFlattened( QRgb foreground, QRgb background ) { - //Q_ASSERT( qAlpha( background ) == 255 ); - - const auto r2 = qAlpha( foreground ) / 255.0; - const auto r1 = 1.0 - r2; - - const auto r = qRound( r1 * qRed( background ) + r2 * qRed( foreground ) ); - const auto g = qRound( r1 * qGreen( background ) + r2 * qGreen( foreground ) ); - const auto b = qRound( r1 * qBlue( background ) + r2 * qBlue( foreground ) ); + const auto alpha = qAlpha( foreground ) / 255.0; - return qRgb( r, g, b ); + return QskRgb::interpolated( background, foreground, alpha ); } inline constexpr QRgb rgbSolid( QRgb foreground, QRgb background )