Skip to content

Commit

Permalink
html: Don't hard-code colors in the C++ code, simplify CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Jun 6, 2014
1 parent ff0dd14 commit 580a18f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Binary file modified data/bcov.css
Binary file not shown.
8 changes: 4 additions & 4 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
<tbody>
<tr data-template>
<td class="coverFile"><a href="{{link}}" title="{{title}}">{{summary_name}}</a></td>
<td class="coverPer"><span style='background-color:{{covered_color}};display:block;width:{{covered}}%'>{{covered}}%</td>
<td class="coverPerNum">{{covered_lines}}</td>
<td class="coverPerNum">{{uncovered_lines}}</td>
<td class="coverPerNum">{{total_lines}}</td>
<td class="coverPer"><span style="display:block;width:{{covered}}%" class="{{covered_class}}">{{covered}}%</td>
<td class="coverNum">{{covered_lines}}</td>
<td class="coverNum">{{uncovered_lines}}</td>
<td class="coverNum">{{total_lines}}</td>
</tr>
</tbody>
</table>
Expand Down
10 changes: 5 additions & 5 deletions src/html-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class HtmlWriter : public WriterBase
"{'link':'%s',"
"'title':'%s',"
"'summary_name':'%s',"
"'covered_color':'%s',"
"'covered_class':'%s',"
"'covered':'%.1f',"
"'covered_lines':'%d',"
"'uncovered_lines':'%d',"
Expand Down Expand Up @@ -295,7 +295,7 @@ class HtmlWriter : public WriterBase
"{'link':'%s/index.html',"
"'title':'%s',"
"'summary_name':'%s',"
"'covered_color':'%s',"
"'covered_class':'%s',"
"'covered':'%.1f',"
"'covered_lines':'%d',"
"'uncovered_lines':'%d',"
Expand Down Expand Up @@ -359,11 +359,11 @@ class HtmlWriter : public WriterBase
auto &conf = IConfiguration::getInstance();

if (percent >= conf.getHighLimit())
return "#CAD7FE";
return "lineCov";
else if (percent > conf.getLowLimit())
return "#FFEA20";
return "linePartCov";

return "#FF6230";
return "lineNoCov";
}

std::string getDateNow()
Expand Down

0 comments on commit 580a18f

Please sign in to comment.