[LNT] fix legend color

Early conversion to int causes the color precision lost. Delaying the
conversion fixes it.

Reviewed by: cmatthews

Differential Revision: https://reviews.llvm.org/D76308
diff --git a/lnt/server/ui/templates/v4_graph.html b/lnt/server/ui/templates/v4_graph.html
index ff79038..7393776 100644
--- a/lnt/server/ui/templates/v4_graph.html
+++ b/lnt/server/ui/templates/v4_graph.html
@@ -307,7 +307,7 @@
     </tr>
     {% for machine, test_name, field_name, col, url in legend %}
     <tr class="data-row" data-url="{{url}}">
-      <td style="background-color: #{{ '%02x%02x%02x' % (255*col[0], 255*col[1], 255*col[2]) }}">&nbsp;</td>
+      <td style="background-color: #{{ '%02x%02x%02x' % ((255*col[0])|int, (255*col[1])|int, (255*col[2])|int) }}">&nbsp;</td>
       <td>{{ utils.render_machine(machine) }}</td>
       <td>{{ test_name }}</td>
       <td class="metric">{{ field_name }}</td>
diff --git a/lnt/server/ui/views.py b/lnt/server/ui/views.py
index f141311..63af31a 100644
--- a/lnt/server/ui/views.py
+++ b/lnt/server/ui/views.py
@@ -931,7 +931,7 @@
         col = list(util.makeDarkColor(float(i) / num_plots))
         url = "/".join([str(machine.id), str(test.id), str(field_index)])
         legend.append(LegendItem(machine, test.name, field.name,
-                                 tuple(map(int, col)), url))
+                                 tuple(col), url))
 
         # Load all the field values for this test on the same machine.
         #
@@ -985,7 +985,7 @@
             # Make a color closer to the sample than its neighbour.
             color_offset = float(baseline_id) / num_baselines / 2
             my_color = (i + color_offset) / num_plots
-            dark_col = list(map(int, util.makeDarkerColor(my_color)))
+            dark_col = list(util.makeDarkerColor(my_color))
             str_dark_col = util.toColorString(dark_col)
             baseline_plots.append({
                 'color': str_dark_col,