Clamp colour of all mono icons

This commit is contained in:
Craig Drummond
2016-07-22 16:37:48 +01:00
parent 536b076760
commit 8fe3968ea9
11 changed files with 45 additions and 56 deletions

View File

@@ -970,6 +970,24 @@ QPainterPath Utils::buildPath(const QRectF &r, double radius)
return path;
}
QColor Utils::clampColor(const QColor &col)
{
static const int constMin=64;
static const int constMax=240;
if (col.value()<constMin) {
return QColor(constMin, constMin, constMin);
} else if (col.value()>constMax) {
return QColor(constMax, constMax, constMax);
}
return col;
}
QColor Utils::monoIconColor()
{
return clampColor(QApplication::palette().color(QPalette::Active, QPalette::WindowText));
}
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KWindowSystem>
#endif