summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-29 11:01:31 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-29 11:02:07 (GMT)
commitff3cc05b6b0f1a7d6cbd8d80b5832667f973132d (patch)
tree10533ae1dd42e19e57da836375d53f21b3cb9285
parentebeeac8d72b258b516929344b43ceec3a57e06e7 (diff)
Fix recoloring of inverted colors.
BUG: 368229
-rw-r--r--ui/pagepainter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp
index aaf68e2..db82119 100644
--- a/ui/pagepainter.cpp
+++ b/ui/pagepainter.cpp
@@ -896,9 +896,9 @@ void PagePainter::recolor(QImage *image, const QColor &foreground, const QColor
for (int x=0; x<image->width(); x++) {
const int lightness = qGray(pixels[x]);
- pixels[x] = qRgba(scaleRed * lightness,
- scaleGreen * lightness,
- scaleBlue * lightness,
+ pixels[x] = qRgba(scaleRed * lightness + foreground.red(),
+ scaleGreen * lightness + foreground.green(),
+ scaleBlue * lightness + foreground.blue(),
qAlpha(pixels[x]));
}
}