mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
@@ -101,9 +101,9 @@ QByteArray ComputeSemiTransparentOverStyle(
|
|||||||
const auto gmina = mina(g0, g1);
|
const auto gmina = mina(g0, g1);
|
||||||
const auto bmina = mina(b0, b1);
|
const auto bmina = mina(b0, b1);
|
||||||
const auto a = std::max({ rmina, gmina, bmina });
|
const auto a = std::max({ rmina, gmina, bmina });
|
||||||
const auto r = (r1 * 255 - r0 * (255 - a)) / a;
|
const auto r = (a > 0) ? ((r1 * 255 - r0 * (255 - a)) / a) : r0;
|
||||||
const auto g = (g1 * 255 - g0 * (255 - a)) / a;
|
const auto g = (a > 0) ? ((g1 * 255 - g0 * (255 - a)) / a) : g0;
|
||||||
const auto b = (b1 * 255 - b0 * (255 - a)) / a;
|
const auto b = (a > 0) ? ((b1 * 255 - b0 * (255 - a)) / a) : b0;
|
||||||
return result(QColor(r, g, b, a));
|
return result(QColor(r, g, b, a));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user