noctalia-shell/Modules/Audio/LinearSpectrum.qml
quadbyte 73c7ba8cdc Switched to Material3 colors principle
- works with matugen only for now
- need to restore rosepine
2025-08-14 18:19:02 -04:00

46 lines
971 B
QML

import QtQuick
import qs.Services
Item {
id: root
property color fillColor: Colors.colorPrimary
property color strokeColor: Colors.colorOnSurface
property int strokeWidth: 0
property var values: []
readonly property real xScale: width / (values.length * 2)
Repeater {
model: values.length
Rectangle {
property real amp: values[values.length - 1 - index]
color: fillColor
border.color: strokeColor
border.width: strokeWidth
antialiasing: true
width: xScale * 0.5
height: root.height * amp
x: index * xScale
y: root.height - height
}
}
Repeater {
model: values.length
Rectangle {
property real amp: values[index]
color: fillColor
border.color: strokeColor
border.width: strokeWidth
antialiasing: true
width: xScale * 0.5
height: root.height * amp
x: (values.length + index) * xScale
y: root.height - height
}
}
}