quickshell/Colors.qml

77 lines
3 KiB
QML

pragma ComponentBehavior: Bound
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
Singleton {
id: root
// --- The Backgrounds (Darkest to Lightest) ---
readonly property color accent: base0D
readonly property color barBg: base01
readonly property color moduleBg: Qt.hsla(base01.hslHue, base01.hslSaturation, base01.hslLightness + 0.05, 1.0)
readonly property color activeModuleBg: Qt.hsla(base01.hslHue, base01.hslSaturation, base01.hslLightness + 0.1, 1.0)
readonly property color text: base06
readonly property color base00: "#" + viewer.base00
readonly property color base01: "#" + viewer.base01
readonly property color base02: "#" + viewer.base02
readonly property color base03: "#" + viewer.base03
readonly property color base04: "#" + viewer.base04
readonly property color base05: "#" + viewer.base05
readonly property color base06: "#" + viewer.base06
readonly property color base07: "#" + viewer.base07
readonly property color base08: "#" + viewer.base08
readonly property color base09: "#" + viewer.base09
readonly property color base0A: "#" + viewer.base0A
readonly property color base0B: "#" + viewer.base0B
readonly property color base0C: "#" + viewer.base0C
readonly property color base0D: "#" + viewer.base0D
readonly property color base0E: "#" + viewer.base0E
readonly property color base0F: "#" + viewer.base0F
FileView {
id: viewer
path: `${Quickshell.env("HOME")}/.config/stylix/palette.json`
watchChanges: true
onAdapterUpdated: reload()
onAdapterChanged: reload()
blockLoading: true
property alias base00: palette.base00
property alias base01: palette.base01
property alias base02: palette.base02
property alias base03: palette.base03
property alias base04: palette.base04
property alias base05: palette.base05
property alias base06: palette.base06
property alias base07: palette.base07
property alias base08: palette.base08
property alias base09: palette.base09
property alias base0A: palette.base0A
property alias base0B: palette.base0B
property alias base0C: palette.base0C
property alias base0D: palette.base0D
property alias base0E: palette.base0E
property alias base0F: palette.base0F
JsonAdapter {
id: palette
property string base00
property string base01
property string base02
property string base03
property string base04
property string base05
property string base06
property string base07
property string base08
property string base09
property string base0A
property string base0B
property string base0C
property string base0D
property string base0E
property string base0F
}
}
}