21 return KColorScheme::shade(color,
static_cast<KColorScheme::ShadeRole
>(role));
26 return KColorScheme::shade(color,
static_cast<KColorScheme::ShadeRole
>(role),
contrast);
31 return KColorScheme::contrastF();
37 retCol.setAlphaF(color.alphaF() * alpha);
43 KColorScheme kcs(active ? QPalette::Active : QPalette::Inactive, KColorScheme::Button);
44 return kcs.background(
static_cast<KColorScheme::BackgroundRole
>(role)).color();
49 KColorScheme kcs(active ? QPalette::Active : QPalette::Inactive, KColorScheme::Button);
50 return kcs.foreground(
static_cast<KColorScheme::ForegroundRole
>(role)).color();
53#include "moc_colorhelper.cpp"
Q_INVOKABLE QColor multiplyAlpha(const QColor &color, qreal alpha)
Q_INVOKABLE QColor foreground(bool active, ForegroundRole role=NormalText) const
Q_INVOKABLE QColor shade(const QColor &color, ShadeRole role)
Q_INVOKABLE QColor background(bool active, BackgroundRole role=NormalBackground) const
ColorHelper(QObject *parent=nullptr)