aboutsummaryrefslogtreecommitdiffstats
path: root/bin/udt-accent
diff options
context:
space:
mode:
Diffstat (limited to 'bin/udt-accent')
-rwxr-xr-xbin/udt-accent9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/udt-accent b/bin/udt-accent
index e366bb1..72d3a64 100755
--- a/bin/udt-accent
+++ b/bin/udt-accent
@@ -242,9 +242,9 @@ def write_hyprlock_border(name):
def read_palette():
"""Parse palette.rasi into {name: "#rrggbb"}.
- rofi writes colours as #rrggbbaa; QML wants #rrggbb, and every entry in
- that file is fully opaque, so the alpha pair is dropped rather than
- converted. Returns an empty dict if the file is missing, which leaves the
+ rofi writes colours as #rrggbbaa; QML wants #rrggbb, or #aarrggbb when
+ translucent. Only scrim is, so an opaque alpha pair is dropped and any
+ other is moved to the front. Returns an empty dict if the file is missing, which leaves the
QML palette to fall back to its own defaults.
"""
try:
@@ -254,7 +254,8 @@ def read_palette():
found = {}
for key, value in re.findall(r"(\w+):\s*#([0-9a-fA-F]{6,8})\s*;", text):
- found[key] = "#" + value[:6]
+ alpha = value[6:].lower()
+ found[key] = "#" + (alpha if alpha not in ("", "ff") else "") + value[:6]
return found