From 2ccd3a8662c46e1be9cfb21a8d60751c98e78065 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 24 Sep 2025 01:37:53 +1000 Subject: plugin: add image analyser --- services/Colours.qml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'services/Colours.qml') diff --git a/services/Colours.qml b/services/Colours.qml index 83ca2ae..cd86c8f 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -22,7 +22,7 @@ Singleton { readonly property M3Palette current: M3Palette {} readonly property M3Palette preview: M3Palette {} readonly property Transparency transparency: Transparency {} - property real wallLuminance + readonly property alias wallLuminance: analyser.luminance function getLuminance(c: color): real { if (c.r == 0 && c.g == 0 && c.b == 0) @@ -85,16 +85,10 @@ Singleton { onLoaded: root.load(text(), false) } - Connections { - target: Wallpapers + ImageAnalyser { + id: analyser - function onCurrentChanged(): void { - const current = Wallpapers.current; - CUtils.getAverageLuminance(current, l => { - if (Wallpapers.current == current) - root.wallLuminance = l; - }); - } + source: Wallpapers.current } component Transparency: QtObject { -- cgit v1.2.3-freya