Skip to content

Commit

Permalink
Merge pull request #57 from tbabej/develop
Browse files Browse the repository at this point in the history
Fix missing color CSS definitions
  • Loading branch information
ralphbean committed Feb 9, 2015
2 parents a23772b + acaa92f commit e1bd92d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ansi2html/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -93,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):
Expand Down

0 comments on commit e1bd92d

Please sign in to comment.