summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Kraasch <alex@kraasch.eu>2024-01-28 06:48:17 +0100
committerAlex Kraasch <alex@kraasch.eu>2024-01-28 06:48:17 +0100
commitf0f66faff6eb08991d529aefaef4a3ccc18a1240 (patch)
treed67dcd8c110577287766be1ed35a5f00890bbd17
parentacf3bae9d4db12cf421e5cb5f93ee758021a4dbb (diff)
In case alpha value exists remove it for urwid.
-rw-r--r--khal/ui/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/khal/ui/__init__.py b/khal/ui/__init__.py
index 87057729..72cc9dcc 100644
--- a/khal/ui/__init__.py
+++ b/khal/ui/__init__.py
@@ -1321,6 +1321,14 @@ def _add_calendar_colors(
color = collection.default_color
else:
color = cal['color']
+
+ # In case the color contains an alpha value, remove it for urwid.
+ # eg '#RRGGBBAA' -> '#RRGGBB' and '#RGBA' -> '#RGB'.
+ if len(color) == 9:
+ color = color[0:7]
+ elif len(color) == 5:
+ color = color[0:4]
+
entry = _urwid_palette_entry(
attr_template.format(cal['name']),
color,