mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Inverting colors feature
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "pdfglobal.h"
|
||||
|
||||
#include <QRectF>
|
||||
#include <QColor>
|
||||
#include <QByteArray>
|
||||
#include <QDataStream>
|
||||
|
||||
@ -429,6 +430,21 @@ constexpr bool isRectangleHorizontallyOverlapped(const QRectF& r1, const QRectF&
|
||||
return isIntervalOverlap(r1.left(), r1.right(), r2.left(), r2.right());
|
||||
}
|
||||
|
||||
inline QColor invertColor(QColor color)
|
||||
{
|
||||
qreal r = 0.0;
|
||||
qreal g = 0.0;
|
||||
qreal b = 0.0;
|
||||
qreal a = 0.0;
|
||||
|
||||
color.getRgbF(&r, &g, &b, &a);
|
||||
|
||||
r = 1.0 - r;
|
||||
g = 1.0 - g;
|
||||
b = 1.0 - b;
|
||||
return QColor::fromRgbF(r, g, b, a);
|
||||
}
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFUTILS_H
|
||||
|
Reference in New Issue
Block a user