kdeplasma-addons: adjust to Katie changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-06-26 19:14:22 +03:00
parent 3d258ccab2
commit 8348fc1702
2 changed files with 3 additions and 2 deletions

View file

@ -41,6 +41,7 @@
#include <KPushButton>
#include <KStandardAction>
#include <KAction>
#include <KColorUtils>
#include <Plasma/Animator>
#include <Plasma/Animation>
@ -52,7 +53,7 @@
QString defaultBackgroundColor()
{
// returns a suitable background color according to the plasma theme's TextColor
return Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor).lightness() > 100 ? "black" : "yellow";
return KColorUtils::luma(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor)) > qreal(0.4) ? "black" : "yellow";
}
class TopWidget : public QGraphicsWidget

View file

@ -26,7 +26,7 @@ Rectangle {
height: 480
function randomColor() {
root.color = Qt.hsla(Math.random(), 1,0.5,1)
root.color = Qt.hsva(Math.random(), 1,0.5,1)
}
Component.onCompleted: randomColor()