diff --git a/theme.cpp b/theme.cpp index 4ae9a12ab..a19fe3466 100644 --- a/theme.cpp +++ b/theme.cpp @@ -21,10 +21,11 @@ #include +#include +#include +#include #include #include -#include -#include namespace Plasma { @@ -157,6 +158,12 @@ KSharedConfigPtr Theme::colors() const return d->colors; } +QColor Theme::textColor() const +{ + KColorScheme colors(QPalette::Active, KColorScheme::View, Theme::self()->colors()); + return colors.foreground(KColorScheme::NormalText).color(); +} + } #include diff --git a/theme.h b/theme.h index a2f88a40a..bb03343a4 100644 --- a/theme.h +++ b/theme.h @@ -96,6 +96,11 @@ class PLASMA_EXPORT Theme : public QObject */ Q_INVOKABLE KSharedConfigPtr colors() const; + /** + * Returns the text color to be used by items resting on the background + */ + Q_INVOKABLE QColor textColor() const; + Q_SIGNALS: /** * Emitted when the user changes the theme. SVGs should be reloaded at