diff --git a/lobster/tools/core/html_report.py b/lobster/tools/core/html_report.py index 10afcdad..0179af3e 100755 --- a/lobster/tools/core/html_report.py +++ b/lobster/tools/core/html_report.py @@ -258,7 +258,7 @@ def write_item_box_end(doc): doc.add_line('') -def write_html(fd, report, dot): +def write_html(fd, report, dot, color_blind): assert isinstance(report, Report) doc = htmldoc.Document( @@ -286,13 +286,13 @@ def write_html(fd, report, dot): "padding-left" : "0.2em", } doc.style[".item-ok"] = { - "background-color" : "#b2e1b2", + "background-color" : "#b2e1b2" if color_blind else "#efe", } doc.style[".item-partial"] = { "background-color" : "#ffe", } doc.style[".item-missing"] = { - "background-color" : "#ffb2ff", + "background-color" : "#ffb2ff" if color_blind else "#fee", } doc.style[".item-justified"] = { "background-color" : "#eee", @@ -465,6 +465,9 @@ def main(): help="path to dot utility (https://graphviz.org), \ by default expected in PATH", default=None) + ap.add_argument("--color_blind", + action="store_true", + help="Enable color blind mode") options = ap.parse_args() if not os.path.isfile(options.lobster_report): @@ -479,7 +482,8 @@ def main(): with open(options.out, "w", encoding="UTF-8") as fd: write_html(fd = fd, report = report, - dot = options.dot) + dot = options.dot, + color_blind = options.color_blind) print("LOBSTER HTML report written to %s" % options.out)