From 081c9a741d1b0f09d8ab9c66dc9647bb882142c2 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 8 Feb 2015 07:25:00 +0100 Subject: [PATCH 1/2] style: Include all 16 solarized colors in the scheme --- ansi2html/style.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansi2html/style.py b/ansi2html/style.py index 7eb19ee..fcf4535 100644 --- a/ansi2html/style.py +++ b/ansi2html/style.py @@ -61,9 +61,12 @@ def index2(grey): # http://ethanschoonover.com/solarized 'solarized': ("#262626", "#d70000", "#5f8700", "#af8700", "#0087ff", - "#af005f", "#00afaf", "#e4e4e4"), + "#af005f", "#00afaf", "#e4e4e4", + "#1c1c1c", "#d75f00", "#585858", "#626262", "#808080", + "#5f5faf", "#8a8a8a", "#ffffd7", ), } + def get_styles(dark_bg=True, scheme='ansi2html'): css = [ From acaa92ff2370d7ebda85ee68a47bfdb7d309a811 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 8 Feb 2015 07:56:00 +0100 Subject: [PATCH 2/2] style: Encode pallete in 256 color encoding --- ansi2html/style.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansi2html/style.py b/ansi2html/style.py index fcf4535..9731b72 100644 --- a/ansi2html/style.py +++ b/ansi2html/style.py @@ -96,6 +96,15 @@ def get_styles(dark_bg=True, scheme='ansi2html'): css.append(Rule('.ansi4%s' % _index, background_color=pal[_index])) css.append(Rule('.inv4%s' % _index, color=pal[_index])) + # set palette colors in 256 color encoding + pal = SCHEME[scheme] + for _index in range(len(pal)): + css.append(Rule('.ansi38-%s' % _index, color=pal[_index])) + css.append(Rule('.inv38-%s' % _index, background_color=pal[_index])) + for _index in range(len(pal)): + css.append(Rule('.ansi48-%s' % _index, background_color=pal[_index])) + css.append(Rule('.inv48-%s' % _index, color=pal[_index])) + # css.append("/* Define the explicit color codes (obnoxious) */\n\n") for green in range(0, 6):