<% @times.each do |hours| %>
  <div style="float:left;display:inline-block;padding:0 0.5em;width:<%= 100 / @times.to_a.length.to_f %>%;font-size:0.01em;height:10vh;"><%= hours %></div>
<% end %>

<script>
  var hours = 0.0;

  $("div").each(function() {
    var thisDiv = this;
    $.ajax({
      url:"/api/sky_color?hours=" + thisDiv.innerHTML,
      dataType:"json",
      complete: function(data) {
        $(thisDiv).css("background-color", data.responseJSON);
      }
    });
  });

  $(document).ready(function() {
    $("body").append(
      $("<input id='hours-range' type='range' min='0' max='24' step='0.05'></input>").css("width", "100vw"));
      $("#hours-range").on("input", function() {
        hours = parseFloat(this.value);
        $("#test-hours")[0].innerHTML = hours;
        changeBackgroundColor(hours);
      });
    $("body").append($("<span id='test-hours'></span>"));
    window.clearInterval(intervalID);
    $("html").css("transition", "none");
    $("*").css("margin", "0");
  });
</script>

<% @times.each do |hours| %>
  <div style="float:left;display:inline-block;padding:0 0.5em;width:<%= 100 / @times.to_a.length.to_f %>%;font-size:0.01em;height:10vh;"><%= hours %></div>
<% end %>

<script>
  var hours = 0.0;

  $("div").each(function() {
    var thisDiv = this;
    $.ajax({
      url:"/api/sky_color?hours=" + thisDiv.innerHTML,
      dataType:"json",
      complete: function(data) {
        $(thisDiv).css("background-color", data.responseJSON.sky_color);
      }
    });
  });

  $(document).ready(function() {
    $("body").append(
      $("<input id='hours-range' type='range' min='0' max='24' step='0.05'></input>").css("width", "100vw"));
      $("#hours-range").on("input", function() {
        hours = parseFloat(this.value);
        $("#test-hours")[0].innerHTML = hours;
        changeBackgroundColor(hours);
      });
    $("body").append($("<span id='test-hours'></span>"));
    window.clearInterval(intervalID);
    $("html").css("transition", "none");
    $("*").css("margin", "0");
  });
</script>

Fix regression in sky_color_test from new JSON
Fix regression in sky_color_test from new JSON
