Fix index colors

This commit is contained in:
Kovid Goyal 2016-10-20 07:57:03 +05:30
parent 2d9ae7c01f
commit 98482c745a

View File

@ -119,13 +119,15 @@ def validate_font(opts: Options):
def build_ansi_color_tables(opts: Options) -> Tuple[dict, dict]:
fg = {30 + i: getattr(opts, 'color{}'.format(i)) for i in range(8)}
def col(i):
return QColor(getattr(opts, 'color{}'.format(i)))
fg = {30 + i: col(i) for i in range(8)}
fg[39] = opts.foreground
fg.update({90 + i: getattr(opts, 'color{}'.format(i + 8)) for i in range(8)})
fg.update({90 + i: col(i + 8) for i in range(8)})
fg[99] = opts.foreground_bold
bg = {40 + i: getattr(opts, 'color{}'.format(i)) for i in range(8)}
bg = {40 + i: col(i) for i in range(8)}
bg[49] = opts.background
bg.update({100 + i: getattr(opts, 'color{}'.format(i + 8)) for i in range(8)})
bg.update({100 + i: col(i + 8) for i in range(8)})
build_ansi_color_tables.fg, build_ansi_color_tables.bg = fg, bg
build_ansi_color_tables(defaults)