mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use outbox bubble colors, adjust custom colors.
This commit is contained in:
@@ -752,12 +752,11 @@ void ChatBackground::setPrepared(
|
||||
prepared = Ui::PrepareBlurredBackground(std::move(prepared));
|
||||
}
|
||||
if (adjustPaletteRequired()) {
|
||||
if (!gradient.isNull()) {
|
||||
adjustPaletteUsingBackground(gradient);
|
||||
if ((prepared.isNull() || _paper.isPattern())
|
||||
&& !_paper.backgroundColors().empty()) {
|
||||
adjustPaletteUsingColors(_paper.backgroundColors());
|
||||
} else if (!prepared.isNull()) {
|
||||
adjustPaletteUsingBackground(prepared);
|
||||
} else if (!_paper.backgroundColors().empty()) {
|
||||
adjustPaletteUsingColor(_paper.backgroundColors().front());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,6 +818,11 @@ void ChatBackground::adjustPaletteUsingBackground(const QImage &image) {
|
||||
adjustPaletteUsingColor(Ui::CountAverageColor(image));
|
||||
}
|
||||
|
||||
void ChatBackground::adjustPaletteUsingColors(
|
||||
const std::vector<QColor> &colors) {
|
||||
adjustPaletteUsingColor(Ui::CountAverageColor(colors));
|
||||
}
|
||||
|
||||
void ChatBackground::adjustPaletteUsingColor(QColor color) {
|
||||
const auto prepared = color.toHsl();
|
||||
for (const auto &adjustable : _adjustableColors) {
|
||||
|
Reference in New Issue
Block a user