diff --git a/khal/cli.py b/khal/cli.py index baf8c0090..ef7dc5df7 100644 --- a/khal/cli.py +++ b/khal/cli.py @@ -175,7 +175,7 @@ def build_collection(conf, selection): 'color': cal['color'], 'priority': cal['priority'], 'ctype': cal['type'], - 'addresses': cal['addresses'], + 'addresses': cal['addresses'] if 'addresses' in cal else '', } collection = khalendar.CalendarCollection( calendars=props, diff --git a/khal/ui/__init__.py b/khal/ui/__init__.py index 870577294..72cc9dccc 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,