Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent2: Don't flatten border colors to a color without alpha value #345

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions skins/fluent2/QskFluent2Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Loading