mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
- Chnage some hard-coded colors to take into account their background. (#3654)
- Change some SVGs from black to white if their background is too dark.
This commit is contained in:
parent
7eb2e36740
commit
a522255baf
6 changed files with 36 additions and 10 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#include "pixmapgenerator.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QPalette>
|
||||
#include <cmath>
|
||||
#ifdef _WIN32
|
||||
#include "round.h"
|
||||
|
|
@ -163,3 +165,16 @@ QPixmap LockPixmapGenerator::generatePixmap(int height)
|
|||
}
|
||||
|
||||
QMap<int, QPixmap> LockPixmapGenerator::pmCache;
|
||||
|
||||
const QPixmap loadColorAdjustedPixmap(QString name)
|
||||
{
|
||||
if (qApp->palette().windowText().color().lightness() > 200) {
|
||||
QImage img(name);
|
||||
img.invertPixels();
|
||||
QPixmap result;
|
||||
result.convertFromImage(img);
|
||||
return result;
|
||||
} else {
|
||||
return QPixmap(name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue