Commit 2596e1f8 authored by Louis's avatar Louis
Browse files

Colors: Background of badges rows is the same as the line of charts

parent 5061b567
......@@ -21,10 +21,10 @@ class Counter:
def as_id(string):
return "".join(list(filter(str.isalnum, string)))
def random_color(seed):
def random_color(seed, saturation, value):
old_seed = random.random()
random.seed(seed)
rgb = colorsys.hsv_to_rgb(random.random(), .5, .8)
rgb = colorsys.hsv_to_rgb(random.random(), saturation, value)
random.seed(old_seed)
return ("#%02x%02x%02x" % tuple([int(value * 255) for value in rgb]))
......
......@@ -22,7 +22,7 @@
</tr></thead>
<tbody>
{% for package in packages|sort -%}
<tr>
<tr bgcolor="{{ package |color(0.1, 0.8) }}">
{% for badge in badges -%}
<td>
{{ render_badge(badge, packages[package]) }}
......
......@@ -26,7 +26,7 @@
{%- if not loop.last %}, {% endif -%}
{% endfor %}],
lineColors: [{% for key in packagelist.iter_ykeys(name) -%}
"{{ key |color }}"
"{{ key |color(0.5, 0.8) }}"
{%- if not loop.last %}, {% endif -%}
{% endfor %}]
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment