pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

Documented grey colors cannot be used #314

Closed languitar closed 8 years ago

languitar commented 8 years ago

The documentation states that the following colors are usable: black, white, brown, yellow, dark grey, dark green, dark blue, light grey, light green, light blue, dark magenta, dark cyan, dark red, light magenta, light cyan, light red and **

Using one of the grey colors results in:

jwienke@cinnabar ~/.vdirsyncer/status> khal
Traceback (most recent call last):
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/termui.py", line 372, in style
    bits.append('\033[%dm' % (_ansi_colors.index(fg) + 30))
ValueError: tuple.index(x): x not in tuple

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/jwienke/local/all/bin/khal", line 9, in <module>
    load_entry_point('khal==v0.7.1.dev35-ng33c5373', 'console_scripts', 'khal')()
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/cli.py", line 227, in cli
    ctx.invoke(cli.commands[command])
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/cli.py", line 255, in calendar
    full=full
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/controllers.py", line 148, in calendar
    locale=locale)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/calendar_display.py", line 184, in vertical_month
    multiple, color, highlight_event_days, locale)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/calendar_display.py", line 131, in str_week
    multiple, color)
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/khal-v0.7.1.dev35_ng33c5373-py3.4.egg/khal/calendar_display.py", line 82, in str_highlight_day
    return style(dstr[:1], fg=color1, bold=bold1) + \
  File "/homes/jwienke/local/all/opt/khal/lib/python3.4/site-packages/click/termui.py", line 374, in style
    raise TypeError('Unknown color %r' % fg)
TypeError: Unknown color 'grey'
geier commented 8 years ago

Thank you for reporting this. Could you check if I properly fixed this with https://github.com/geier/khal/commit/2629c16394656a3d0a6f2e63358642f782bee8f1 ? (It will probably not look too pretty though).

languitar commented 8 years ago

They can be used now. But light and dark grey all render in the same tone on my terminal.

geier commented 8 years ago

this should be fixed with the enhanced color support, if not, please reopen.