diff --git a/theme.cpp b/theme.cpp index e550d2afb..28f5d01d4 100644 --- a/theme.cpp +++ b/theme.cpp @@ -167,6 +167,12 @@ QColor Theme::textColor() const return colors.foreground(KColorScheme::NormalText).color(); } +QColor Theme::backgroundColor() const +{ + KColorScheme colors(QPalette::Active, KColorScheme::Window, Theme::self()->colors()); + return colors.background().color(); +} + void Theme::setFont(const QFont &font) { d->generalFont = font; diff --git a/theme.h b/theme.h index c108ab86d..6cb06e4b5 100644 --- a/theme.h +++ b/theme.h @@ -103,6 +103,11 @@ class PLASMA_EXPORT Theme : public QObject */ Q_INVOKABLE QColor textColor() const; + /** + * Returns the background color to be used by items resting on the background + */ + Q_INVOKABLE QColor backgroundColor() const; + /** * Sets the default font to be used with themed items. Defaults to * the application wide default font.